A175443 a(1)=2, a(n+1) = smallest prime > a(n) such that a(n+1)+a(n) is multiple of 5.
2, 3, 7, 13, 17, 23, 37, 43, 47, 53, 67, 73, 97, 103, 107, 113, 127, 163, 167, 173, 197, 223, 227, 233, 257, 263, 277, 283, 307, 313, 317, 353, 367, 373, 397, 433, 457, 463, 467, 503, 547, 563, 577, 593, 607, 613, 617, 643, 647, 653, 677, 683, 727, 733, 757
Offset: 1
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A175451.
Programs
-
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 *)
-
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
Comments