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.

A349121 a(n) is the smallest prime p, such that p + k + k^2 are consecutive primes for 0 <= k <= n, but not for k>n.

Original entry on oeis.org

3, 5, 17, 347, 13901, 665111, 128981, 113575727, 2426256797, 137168442221, 4656625081181, 101951758179851, 484511389338941, 221860944705726407
Offset: 1

Views

Author

Marc Morgenegg, Nov 08 2021

Keywords

Comments

a(n) is the smallest prime followed by exactly n prime gaps in arithmetic progression with a common difference of 2 and starting with prime gap 2.

Examples

			a(4)=347, because it is the smallest prime such that 347 + 2 = 349, 349 + 4 = 353, 353 + 6 = 359, 359 + 8 = 367 are 5 consecutive primes.
		

Crossrefs

Cf. A016045, A001223 (prime gaps), A036263 (2nd differences), A158939 (monotonic increasing).

Programs

  • Mathematica
    Table[k=2;While[Flatten[k+(s={Range[0,n]})+s^2]!=NextPrime[k,Range[0,n]]||NextPrime[k,n+1]==k+n+1+(n+1)^2,k=NextPrime@k];k,{n,7}] (* Giorgos Kalogeropoulos, Nov 10 2021 *)
  • PARI
    isok(p, n) = my(q=p); for (k=1, n, my(r = p+k+k^2); if (nextprime(q+1) != r, return (0)); q=r); return(1);
    a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p; \\ Michel Marcus, Nov 09 2021