OFFSET
0,3
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..4096
FORMULA
EXAMPLE
For n = 9:
- the binary representation of 9 is "1001",
- the following positive binary strings appear in it: "1", "10", "11", "100", "101" and "1001",
- they correspond to: 1, 2, 3, 4, 5 and 9,
- so a(9) = 1 * 2 * 3 * 4 * 5 * 9 = 1080.
PROG
(PARI) a(n) = my (b=binary(n), s=[0]); for (i=1, #b, s=setunion(s, apply(m -> 2*m+b[i], s))); vecprod(s[2..#s])
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 05 2020
STATUS
approved
