A104640 Number of odd digits in n^3.
1, 0, 1, 0, 2, 1, 2, 2, 2, 1, 4, 2, 3, 1, 4, 1, 3, 2, 2, 0, 2, 1, 3, 2, 3, 4, 3, 3, 2, 1, 4, 2, 5, 3, 2, 1, 3, 2, 5, 0, 2, 1, 4, 2, 4, 4, 3, 4, 4, 2, 4, 1, 3, 3, 4, 4, 5, 5, 4, 1, 2, 2, 2, 1, 2, 2, 3, 3, 3, 2, 6, 3, 4, 1, 3, 3, 4, 3, 4, 2, 4, 4, 5, 3, 3, 2, 3, 2, 3, 2, 6, 2, 3, 2, 5, 2, 4, 4, 4, 1
Offset: 1
Links
- G. C. Greubel, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Table[Count[IntegerDigits[n^3],?OddQ],{n,100}] (* _Harvey P. Dale, Jun 23 2017 *)
-
PARI
a(n) = my(d = digits(n^3)); sum(i=1, #d, d[i] % 2); \\ Michel Marcus, Oct 05 2013
Formula
a(n) = A196564(n^3). - Michel Marcus, Oct 05 2013
Comments