A033109 Number of 8's when n is written in base b for 2<=b<=n+1.
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 4, 1, 2, 2, 3, 1, 3, 1, 3, 3, 2, 1, 4, 1, 3, 2, 3, 1, 4, 2, 3, 2, 2, 1, 6, 1, 2, 3, 4, 3, 5, 2, 4, 3, 5, 2, 8, 2, 3, 4, 4, 3, 5, 2, 7, 5, 3
Offset: 1
Crossrefs
Programs
-
Mathematica
f[n_] := Count[Flatten@ Table[ IntegerDigits[n, b], {b, 2, n + 1}], 8]; Array[f, 90] (* Robert G. Wilson v, Nov 14 2012 *)