OFFSET
0,6
COMMENTS
Interleaving (or shuffling) two strings means combining all their characters while preserving the order of all characters in individual strings; for example, "12345" is the interleaving of "14" and "235".
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..8192
Rémy Sigrist, C program for A330925
FORMULA
a(n) = 0 iff n is zero or a power of 2.
a(2*n) = 2*a(n).
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*y
------- - - ---
"101" 5 0 0
"1/01" 1 1 1
"10/1" 2 1 2
"1/0/1" 3 0 0
- hence a(5) = 2.
PROG
(C) See Links section.
CROSSREFS
See A327186 for similar sequences where we split the binary representation.
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 03 2020
STATUS
approved