OFFSET
1,1
COMMENTS
Primes which under repeated summation of digits eventually reach 1, 2, 4 or 8.
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..10000
EXAMPLE
The prime 229 is a member since 229 -> 13 -> 4.
MAPLE
A166849 := proc(n) option remember: local k: if(n=1)then return 2:fi: k:=nextprime(procname(n-1)): do if((k-1) mod 9 in {0, 1, 3, 7})then return k: fi: k:=nextprime(k): od: end: seq(A166849(n), n = 1..54); # Nathaniel Johnston, May 04 2011
MATHEMATICA
dr[n_]:=NestWhile[Total[IntegerDigits[#]]&, n, #>9&]; Select[Prime[Range[ 100]], MemberQ[{1, 2, 4, 8}, dr[#]]&] (* Harvey P. Dale, Oct 25 2011 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Alexander R. Povolotsky, Oct 21 2009
EXTENSIONS
Edited by N. J. A. Sloane and Zak Seidov, Oct 23 2009
More terms a(11)-a(51) from Vincenzo Librandi, Oct 24 2009
STATUS
approved