login
A033097
Number of 2's when n is written in base b for 2<=b<=n+1.
10
0, 1, 0, 0, 1, 2, 2, 4, 2, 4, 4, 4, 3, 7, 4, 6, 7, 7, 5, 9, 5, 9, 8, 9, 8, 14, 7, 7, 8, 9, 6, 13, 8, 12, 12, 10, 11, 16, 9, 11, 12, 16, 11, 16, 10, 14, 15, 12, 11, 20, 14, 17, 16, 15, 12, 19, 15, 19, 16, 16, 15, 25, 15, 17, 19, 19, 17, 21, 16, 19, 18
OFFSET
1,6
MATHEMATICA
f[n_] := Count[Flatten@ Table[ IntegerDigits[n, b], {b, 2, n + 1}], 2]; Array[f, 70] (* Robert G. Wilson v, Nov 14 2012 *)
KEYWORD
nonn,base
STATUS
approved