A269242 Number of times the digit 2 appears in the decimal expansion of n^3.
0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 2, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 1, 2, 2, 1, 0, 1, 1, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1
Offset: 0
Examples
0^3 = 0 has a(0) = 0 digits '2'. 1^3 = 1 has a(1) = 0 digits '2'. 2^3 = 8 has a(2) = 0 digits '2'. 3^3 = 27 has a(3) = 1 digits '2'. 4^3 = 64 has a(4) = 0 digits '2'. 5^3 = 125 has a(5) = 1 digit '2'. 28^3 = 21952 is the least cube which has a(28) = 2 digits '2'.
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
Crossrefs
Programs
-
Magma
[Multiplicity(Intseq(n^3),2): n in [0..100]]; // Marius A. Burtea, Jan 26 2020
-
Maple
seq(numboccur(2,convert(n^3,base,10)),n=0..100); # Robert Israel, Jan 26 2020
-
Mathematica
Table[DigitCount[n^3, 10, 2], {n, 0, 100}] (* Robert Price, Mar 21 2020 *)
-
PARI
A269242(n)=#select(t->t==2,digits(n^3))
Comments