OFFSET
1,6
COMMENTS
Differs from A236314 at n=99.
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..10000 (terms 1..999 from Christian Perfect).
MATHEMATICA
a[n_] := Length[StringPosition @@ ToString /@ {n^n, n}]; Array[a, 99] (* Giovanni Resta, Jan 22 2014 *)
PROG
(Python)
from itertools import count
def occurrences(string, sub):
....count = start = 0
....while True:
........start = string.find(sub, start) + 1
........if start > 0:
............count+=1
........else:
............return count
def a(n):
....return occurrences(str(n**n), str(n))
(PARI) a(n) = my(m=Mod(n, 10^#Str(n))); (m==n=n^n)+sum(i=0, 1+log(n)/log(10), m==n\=10) \\ - M. F. Hasler, Jan 23 2014
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Christian Perfect, Jan 22 2014
STATUS
approved