OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
The sums of the digits of a(n) form the sequence d(n) = 2, 2, 4, 8, 4, 8, 8, 16, ... in which either d(n)/d(n+1) or d(n+1)/d(n) is an integer.
MAPLE
A178796 := proc(n) option remember; if n = 1 then 2; else a := nextprime(procname(n-1)) ; while true do r := A007953(a)/ A007953(procname(n-1)) ; if numer(r) = 1 or denom(r) = 1 then return a; end if; a := nextprime(a) ; end do: end if; end proc:
seq(A178796(n), n=1..80) ; # R. J. Mathar, Jun 28 2010
MATHEMATICA
nxt[n_]:=Module[{k=NextPrime[n], tidn=Total[IntegerDigits[n]]}, While[ !Divisible[ Total[ IntegerDigits[ k]], tidn] && !Divisible[ tidn, Total[ IntegerDigits[k]]], k=NextPrime[k]]; k]; NestList[nxt, 2, 60] (* Harvey P. Dale, Aug 23 2017 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Giovanni Teofilatto, Jun 15 2010
EXTENSIONS
Corrected by Giovanni Teofilatto, Jun 25 2010
Definition corrected, sequence extended, example added by R. J. Mathar, Jun 28 2010
STATUS
approved