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.

A212883 Numbers n such that n^4 - prime(n) is prime.

Original entry on oeis.org

2, 6, 40, 76, 144, 146, 148, 166, 168, 174, 186, 192, 210, 220, 222, 230, 238, 240, 258, 290, 338, 364, 372, 378, 384, 398, 400, 402, 442, 446, 482, 492, 532, 536, 554, 570, 606, 628, 654, 700, 740, 882, 888, 944, 954, 964, 966, 978, 1038, 1040, 1072, 1080
Offset: 1

Views

Author

Zak Seidov, May 29 2012

Keywords

Comments

See A064712 for the sequence of values of n such that n^2-prime(n) is prime. - John W. Layman, May 29 2012
All terms are even. - M. F. Hasler, Jun 02 2012

Crossrefs

Programs

  • Magma
    [n: n in [1..1200]|IsPrime(n^4-NthPrime(n))];
    
  • Maple
    A[1]:= 2: p:= 3: count:= 1:
    for n from 4 to 10^4 by 2 do
       p:= nextprime(nextprime(p));
       if isprime(n^4-p) then
         count:= count+1;
         A[count]:= n;
       fi
    od:
    seq(A[i],i=1..count); # Robert Israel, Jun 20 2017
  • Mathematica
    Reap[Do[If[PrimeQ[n^4-Prime[n]],Sow[n]],{n,2,1200,2}]][[2,1]]
    Select[Range[1200],PrimeQ[#^4-Prime[#]]&] (* Harvey P. Dale, Mar 26 2025 *)
  • PARI
    for(n=1,999,isprime(n^4-prime(n))&print1(n","))  \\ M. F. Hasler, Jun 02 2012