OFFSET
1,3
COMMENTS
Question: Are there any terms larger than 1 after a(22) = 2? In other words, do all terms of A014566 contain zero somewhere in their decimal representation after A014566(22) = 341427877364219557396646723585? - Antti Karttunen, Oct 08 2017
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..2048
FORMULA
EXAMPLE
For n=4 we have A014566(4) = Sierpinski number 257 --> 2*5*7 = 70 --> 7*0 = 0 thus persistence = 2, and a(4) = 2. - Edited by Antti Karttunen, Oct 08 2017
MAPLE
P:=proc(n) local i, k, w, ok, cont; for i from 1 by 1 to n do w:=1; k:=i^i+1; ok:=1; if k<10 then print(0); else cont:=1; while ok=1 do while k>0 do w:=w*(k-(trunc(k/10)*10)); k:=trunc(k/10); od; if w<10 then ok:=0; print(cont); else cont:=cont+1; k:=w; w:=1; fi; od; fi; od; end: P(100);
MATHEMATICA
Table[-1 + Length@ NestWhileList[Times @@ IntegerDigits@ # &, If[n == 0, 2, n^n + 1], # > 9 &], {n, 105}] (* Michael De Vlieger, Oct 08 2017 *)
PROG
(Scheme)
;; The whole program follows:
(define (A014566 n) (+ 1 (expt n n)))
(define (A007954 n) (if (zero? n) n (let loop ((n n) (m 1)) (if (zero? n) m (let ((d (modulo n 10))) (loop (/ (- n d) 10) (* d m)))))))
;; Antti Karttunen, Oct 08 2017
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Jul 20 2007
STATUS
approved