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.

Showing 1-2 of 2 results.

A257467 Smallest prime number p such that p + psq(1), p + psq(2), ... p + psq(n) are all prime but p+psq(n+1) is not. (psq(n) is the square of the primorial.)

Original entry on oeis.org

2, 3, 43, 7, 163, 397, 5527, 454543, 615883, 142516687, 68967673, 57502725253, 37520993053, 2630665498987, 39809897510563
Offset: 0

Views

Author

Fred Schneider, Apr 25 2015

Keywords

Examples

			For prime 43, 43 + 4 and 43 + 36 are prime but not 43 + 30^2.
		

Crossrefs

Programs

  • PARI
    psq(n)=my(P=1); forprime(p=2, prime(n), P*=p); P^2;
    isokpsq(p, n) = {for (k=1, n, if (!isprime(p+psq(k)), return (0));); if (!isprime(p+psq(n+1)), return (1));}
    a(n) = {p = 2; while (!isokpsq(p,n), p = nextprime(p+1)); p;} \\ Michel Marcus, May 04 2015
    
  • PARI
    allprime(v,n=0)=for(i=1,#v,if(!isprime(v[i]+n), return(0))); 1
    a(n)=if(n<2,return(n+2)); my(t=4,v=vector(n-1,i,t*=prime(i+1)^2),p=2); t*=prime(n+1)^2; forprime(q=3,, if(q-p==4 && allprime(v,p) && !isprime(t+p), return(p)); p=q) \\ Charles R Greathouse IV, May 05 2015

Extensions

a(13)-a(14) from Fred Schneider, May 16 2015

A258035 Smallest prime number p such that p + pssq(1), p + pssq(2), ... p + pssq(n) are all prime but p+pssq(n+1) is not, where pssq(n) is the partial sum of the square of the proper terms of the primorial (A189997(n)-1).

Original entry on oeis.org

2, 37, 3, 7, 13, 277, 2617, 43, 2924263, 300999679, 631112173, 1368737917, 4428230508349
Offset: 0

Views

Author

Fred Schneider, May 16 2015

Keywords

Examples

			a(3) = 7 because 7 + 4, 7 + 40 and 7 + 940 are primes, but 7 + 45040 = 107 * 421 is not.
		

Crossrefs

Cf. A257466 (analog for partial primorial sum), A257467 (analog for primorial squared).
Showing 1-2 of 2 results.