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.

A242046 Least integer k > n + 1 such that n^2 + (n + 1)^2 + k^2 is prime.

Original entry on oeis.org

2, 6, 4, 6, 24, 14, 8, 12, 16, 24, 24, 14, 14, 24, 16, 20, 42, 20, 26, 54, 30, 26, 30, 28, 26, 54, 42, 38, 42, 34, 40, 48, 38, 36, 36, 44, 48, 102, 42, 46, 54, 44, 50, 48, 60, 54, 66, 50, 54, 54, 54, 54, 54, 56, 64, 84, 58, 62, 84, 64, 66, 78, 64, 66, 84, 74
Offset: 0

Views

Author

Zak Seidov, Aug 24 2014

Keywords

Comments

If n is in A027863 then a(n) = n + 2, otherwise a(n) > n + 2. All terms are even. Corresponding primes are 5, 41, 29, 61, 617, ...

Crossrefs

Cf. A027863.

Programs

  • Mathematica
    lk[n_]:=Module[{k=n+2,c=n^2+(n+1)^2},While[!PrimeQ[c+k^2],k++];k]; Array[ lk,70,0] (* Harvey P. Dale, Aug 06 2015 *)
  • PARI
    a(n)=k=n+2; while(!isprime(n^2+(n+1)^2+k^2), k++); k
    vector(100,n,a(n-1)) \\ Jens Kruse Andersen, Aug 26 2014

Extensions

Corrected and extended by Jens Kruse Andersen, Aug 26 2014