login
A330962
For any n >= 0: consider all pairs of numbers (x, y) whose binary representations can be interleaved (or shuffled) to produce the binary representation of n (possibly with leading zeros); a(n) is the least possible value of x^2 + y^2.
2
0, 1, 1, 2, 1, 2, 5, 10, 1, 2, 5, 10, 8, 10, 13, 18, 1, 2, 5, 10, 8, 10, 13, 18, 9, 10, 13, 18, 25, 34, 45, 58, 1, 2, 5, 10, 8, 10, 13, 18, 9, 10, 13, 18, 25, 34, 45, 58, 9, 10, 13, 18, 25, 34, 45, 58, 49, 50, 53, 58, 65, 74, 85, 98, 1, 2, 5, 10, 8, 10, 13, 18
OFFSET
0,4
EXAMPLE
For n = 5:
- the binary representation of 5 is "101",
- the possible values for (x, y), restricted to x >= y without loss of generality, are:
bin(5) x y x^2+y^2
------- - - -------
"101" 5 0 25
"1/01" 1 1 2
"10/1" 2 1 5
"1/0/1" 3 0 9
- hence a(5) = 2.
PROG
(C) See Links section.
CROSSREFS
See A330925 for similar sequences.
Cf. A327194.
Sequence in context: A201163 A049901 A117715 * A327194 A160457 A107087
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 04 2020
STATUS
approved