cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A175443 a(1)=2, a(n+1) = smallest prime > a(n) such that a(n+1)+a(n) is multiple of 5.

Original entry on oeis.org

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

Views

Author

Zak Seidov, May 28 2010

Keywords

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

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