login
A038809
a(n) is the number of ways to write n in bases 2-10 such that the digit k-1 appears in the representation in base k.
0
0, 1, 2, 2, 2, 3, 3, 4, 3, 3, 1, 4, 2, 3, 4, 4, 2, 4, 2, 5, 4, 3, 3, 6, 3, 2, 3, 3, 2, 6, 3, 4, 3, 3, 5, 5, 1, 1, 2, 5, 1, 4, 3, 4, 6, 5, 5, 7, 5, 5, 3, 3, 3, 5, 4, 5, 4, 4, 4, 7, 4, 4, 6, 4, 3, 3, 3, 4, 3, 6, 4, 7, 4, 4, 4, 4, 5, 5, 4, 7, 3, 1, 1, 5, 2, 1, 2, 4, 2, 6, 3, 4, 5, 4, 5, 8, 5, 5, 5, 5, 3, 4, 4, 6, 5
OFFSET
0,3
EXAMPLE
a(11)=4 since 11 = 15 (base 6) = 23 (base 4) = 102 (base 3) = 1011 (base 2).
PROG
(PARI) a(n) = {nb = 0; for (b=2, 10, if (n, digs = digits(n, b), digs = [0]); for (i=1, #digs, if (digs[i] == b-1, nb++; break; ); ); ); return (nb); }\\ Michel Marcus, Jul 14 2013
CROSSREFS
Sequence in context: A064822 A238337 A104484 * A337496 A078342 A177903
KEYWORD
nonn,base
EXTENSIONS
Additional comments from Larry Reeves (larryr(AT)acm.org), Mar 16 2001
a(0) corrected by Michel Marcus, Jul 14 2013
STATUS
approved