OFFSET
1,3
COMMENTS
All terms are odd.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..8192
FORMULA
a(n) = 1 iff n is a power of 2.
a(n) = n iff n is a positive Mersenne number (A000225). - Bernard Schott, Aug 26 2019
EXAMPLE
For n=42:
- the binary representation of 85 is "1010101",
- there are 6 ways to split it:
- "1" and "010101": x=1 and y=21: 1 * 21 = 21,
- "10" and "10101": x=2 and y=21: 2 * 21 = 42,
- "101" and "0101": x=5 and y=5: 5 * 5 = 25,
- "1010" and "101": x=10 and y=5: 10 * 5 = 50,
- "10101" and "01": x=21 and y=1: 21 * 1 = 21,
- "101010" and "1": x=42 and y=1: 42 * 1 = 42,
- hence a(42) = 21.
PROG
(PARI) a(n) = my (v=oo, b=binary(2*n+1)); for (w=1, #b-1, v=min(v, (fromdigits(b[1..w], 2) * fromdigits(b[w+1..#b], 2)))); v
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Aug 25 2019
STATUS
approved