OFFSET
1,1
COMMENTS
Lexicographically first subsequence of primes such that the sum of any two adjacent terms is a multiple of 5. - Charles R Greathouse IV, Apr 13 2015
For n >= 1, a(2*n) == 3 (mod 10) and a(2*n+1) == 7 (mod 10). - Robert Israel, Apr 13 2015
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
MAPLE
a[1]:= 2: a[2]:= 3:
for n from 2 to 99 do
for t from a[n]+ (-2*a[n] mod 10) by 10 while not isprime(t) do od:
a[n+1]:= t;
od:
seq(a[n], n=1..100); # Robert Israel, Apr 13 2015
MATHEMATICA
spm5[n_]:=Module[{p=NextPrime[n]}, While[!Divisible[n+p, 5], p = NextPrime[ p]]; p]; NestList[spm5, 2, 60] (* Harvey P. Dale, Jan 02 2017 *)
PROG
(PARI) list(lim)=my(v=List([2])); forprime(p=2, lim, if((v[#v]+p)%5, , listput(v, p))); Vec(v) \\ Charles R Greathouse IV, Apr 13 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, May 28 2010
STATUS
approved