A236314 Number of non-overlapping occurrences of n in the decimal representation of n^n.
1, 0, 0, 0, 1, 3, 0, 0, 1, 1, 2, 0, 0, 0, 0, 2, 1, 0, 2, 0, 2, 0, 0, 1, 2, 0, 0, 1, 0, 0, 2, 2, 2, 0, 3, 1, 1, 0, 1, 0, 1, 1, 1, 0, 3, 1, 0, 1, 1, 1, 1, 2, 2, 1, 0, 1, 1, 0, 1, 3, 2, 0, 1, 1, 0, 2, 0, 0, 0, 0, 1, 0, 1, 1, 2, 5, 2, 1, 2, 0, 3, 3, 2, 1, 0, 1, 0
Offset: 1
Examples
6^6 is 46656 with 3 6's, hence a(6) = 3.
Links
- Scott R. Shannon, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
a[n_] := Length@ StringPosition[ToString[n^n], ToString[n], Overlaps -> False]; (* Giovanni Resta, Jan 22 2014 *)
-
Python
from itertools import count a=(str(n**n).count(str(n)) for n in count(1))