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.

A329973 Smallest prime p such that both 2*prime(n+1)+p and p*prime(n+1)+2 are primes.

Original entry on oeis.org

5, 3, 3, 7, 3, 3, 3, 7, 3, 5, 23, 67, 3, 7, 7, 13, 5, 5, 7, 5, 5, 67, 3, 3, 37, 17, 43, 5, 13, 3, 7, 127, 3, 19, 5, 17, 53, 3, 3, 43, 5, 19, 23, 3, 3, 101, 17, 3, 41, 37, 13, 17, 7, 7, 37, 3, 59, 23, 31, 257, 7, 47, 31, 5, 7, 11, 3, 67, 3, 3, 43, 23
Offset: 1

Views

Author

Ivan N. Ianakiev, Jun 08 2020

Keywords

Comments

a(n)=3 if and only if prime(n+1) is in A106067. - Robert Israel, Jul 17 2020

Crossrefs

Programs

  • Maple
    f:= proc(n) local pn,p;
     pn:= ithprime(n+1);
     p:= 1;
     do
       p:= nextprime(p);
       if isprime(2*pn+p) and isprime(p*pn+2) then return p fi
     od
    end proc:
    map(f, [$1..100]); # Robert Israel, Jul 17 2020
  • Mathematica
    f[n_Integer/;n>1]:=Module[{p=3},While[Or[CompositeQ[2*Prime[n]+p],CompositeQ[p*Prime[n]+2]],p=NextPrime[p]];p];f/@Range[2,100]
  • PARI
    a(n) = my(p=2,q=prime(n+1)); while(!isprime(2*q+p) || !isprime(p*q+2), p=nextprime(p+1)); p; \\ Michel Marcus, Jun 08 2020