OFFSET
0,1
COMMENTS
Only primes with most significant digit even.
EXAMPLE
n=0: 2
n=1: 29 -> 11
n=2: 227 -> 499 -> 383
n=3: 22807 -> 40879 -> 48563 -> 23197
n=4: 86269 -> 48857 -> 26321 -> 89533 -> 74861
n=5: 2206031 -> 4266343 -> 6829777 -> 4016443 -> 4170877 -> 5878541
n=6: 668880743 -> 246687179 -> 602458861 -> 626936477 -> 885290143 -> 637191571 -> 908006287
n=7: 4208046655963 -> 6288402104597 -> 8062423149463 -> 8686654533091 -> 4442199863909 -> 8863087492993 -> 6493851311821 -> 321364429037.
MAPLE
with(numtheory);
T:=proc(t) local j, w, x, y; x:=t; y:=[]; while x>0 do
y:=[x mod 10, op(y)]; x:=trunc(x/10); od; w:=(y[nops(y)]+y[1]) mod 10;
x:=0; for j from 1 to nops(y)-1 do x:=x*10+((y[j]+y[j+1]) mod 10); od; x:=x*10+w; end:
P:=proc(q) local a, b, n, v; v:=array(0..50);
for n from 0 to 50 do v[n]:=0; od; v[0]:=2; lprint(0, 2);
for n from 1 by 2 to q do if isprime(n) then b:=-1; a:=n;
while isprime(a) do b:=b+1; a:=T(a); od; if v[b]=0 then
v[b]:=n; lprint(b, n); fi; fi; od; end: P(10^10);
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Paolo P. Lava, Jul 01 2014
EXTENSIONS
a(7) from Giovanni Resta, Jul 03 2014
STATUS
approved