Dd4d2FṙJ$ḄṢIS
Try it online!
How it works
Dd4d2FṙJ$ḄṢIS Main link. Argument: n
D Decimal; convert n to base 10 (digit array).
d4 Divmod 4; map each digit d to [d/4, d%4].
d2 Divmod 2; map each [d/4, d%4] to [[d/8, d/4%2], [d%4/2, d%2]].
F Flatten the resulting 3D binary array.
ṙJ$ Take all possible rotations.
Ḅ Convert each rotation from binary to integer.
Ṣ Sort the resulting integer array.
I Take the forward differences.
S Take the sum.
|
answered Nov 16 '17 at 2:49
Dennis
196k3838 gold badges328328 silver badges769769 bronze badges
|