OFFSET
1,2
COMMENTS
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
MAPLE
isA002113 := proc(n) n = digrev(n) ; end proc:
A180458 := proc(n) local p ; p := ithprime(n) ; while not isA002113(p) do p := p-1 ; end do; p ; end proc:
A180600 := proc(n) option remember; if n = 1 then 1; else if A180458(n) = A180458(n-1) then procname(n-1) ; else procname(n-1)+1 ; end if; end if; end proc:
seq(A180600(n), n=1..90) ; # R. J. Mathar, Oct 24 2010
MATHEMATICA
lpn[n_]:=Module[{k=0}, While[!PalindromeQ[n-k], k++]; n-k]; nxt[{n_, l_, a_}] := Module[{x=lpn[Prime[n+1]]}, {n+1, x, If[x==l, a, a+1]}]; NestList[ nxt, {1, 1, 1}, 80][[All, 3]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 18 2020 *)
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Giovanni Teofilatto, Sep 11 2010
EXTENSIONS
Sequence corrected starting near a(54), definition corrected, comment and formula added by R. J. Mathar, Oct 24 2010
STATUS
approved