OFFSET
1,1
COMMENTS
a(n) + a(n+1) = 0 (mod 10) for all n >= 1.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
MAPLE
a:= proc(n) option remember; local p, d;
if n=1 then p:= 11
else p:= a(n-1); d:= `if`(n::odd, 1, 9);
while irem(p, 10)<>d do p:=nextprime(p) od
fi; p
end:
seq(a(n), n=1..100); # Alois P. Heinz, May 11 2016
MATHEMATICA
a[1] = 11; a[n_] := a[n] = Block[{d, q = a[n-1]}, d=10-Mod[q, 10]; While[ Mod[q = NextPrime@ q, 10] != d]; q]; Array[a, 30] (* Giovanni Resta, May 11 2016 *)
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Giovanni Teofilatto, May 11 2016
STATUS
approved