A116943 Number of 4s digits plus non-final 3s digits 3 base 5 expansion of 2^n.
0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 3, 2, 2, 2, 1, 1, 3, 4, 5, 3, 3, 1, 4, 4, 7, 2, 7, 7, 4, 6, 9, 9, 6, 5, 5, 7, 4, 9, 4, 7, 7, 7, 10, 8, 6, 8, 6, 9, 8, 9, 8, 10, 11, 11, 8, 13, 5, 11, 15, 13, 10, 10, 8, 12, 9, 14, 11, 8, 11, 12, 10, 13, 13, 13, 10, 10, 12, 6, 10, 15, 8, 17, 17, 16, 16, 12, 16, 15, 13
Offset: 0
Examples
a(7) = 0 because 2^7 (modulo 5) = 1003, which contains 0 digits 4 plus 0 non-final digits 3 (it has a digit 3, but that digit is finial, meaning rightmost). a(10) = 3 because 2^10 mod 5 = 13044, which contains 2 digits 4 plus 1 non-final digits 3, so 2 + 1 = 3. a(60) = 10 because 2^60 mod 5 = 34132411211412413323100401, which contains 5 digits 4 plus 5 non-final digits 3, so 5 + 5 = 10.
Programs
-
Mathematica
f[n_] := Block[{id = IntegerDigits[2^n, 5]}, Count[id, 4] + Count[Most@id, 3]]; Table[ f[n], {n, 0, 88}] (* Robert G. Wilson v *)
Extensions
More terms from Robert G. Wilson v, Apr 01 2006
Comments