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.

A290767 Primes p such that p^2 +/- p +/- 1 are all nonprimes.

Original entry on oeis.org

23, 37, 43, 73, 107, 109, 113, 137, 157, 179, 211, 223, 227, 229, 239, 251, 257, 271, 277, 283, 311, 313, 317, 347, 353, 367, 389, 439, 443, 467, 503, 509, 521, 523, 547, 557, 563, 577, 587, 593, 601, 631, 653, 661, 719, 733, 757, 797, 811, 821, 823, 829, 853, 859, 877, 883
Offset: 1

Views

Author

Ralf Steiner, Aug 10 2017

Keywords

Crossrefs

Programs

  • Maple
    select(p -> isprime(p) and not ormap(isprime, [p^2+p+1,p^2+p-1,p^2-p+1,p^2-p-1]), [2,seq(i,i=3..1000,2)]); # Robert Israel, Aug 10 2017
  • Mathematica
    Select[Prime[Range[1000]], ! (PrimeQ[#^2 + # + 1] || PrimeQ[#^2 + # - 1] ||PrimeQ[#^2 - # + 1] || PrimeQ[#^2 - # - 1]) &]
    Select[Prime[Range[200]],NoneTrue[{#^2+#+1,#^2+#-1,#^2-#+1,#^2-#-1},PrimeQ]&] (* Harvey P. Dale, Oct 13 2024 *)
  • PARI
    is(n) = my(v=[n^2+n+1, n^2+n-1, n^2-n+1, n^2-n-1]); for(k=1, #v, if(ispseudoprime(v[k]), return(0))); 1
    forprime(p=1, 900, if(is(p), print1(p, ", "))) \\ Felix Fröhlich, Aug 10 2017

Formula

Intersection of the complements of A053184, A053182, A065508, and A091567 within the primes A000040.

A248031 Least number k such that k^n +- k +- 1 is prime for all four possibilities, or 0 if no such k exists.

Original entry on oeis.org

3, 15, 6, 0, 30594, 246819, 0, 4033590, 2298429, 0, 19209840, 13542816, 0, 3979836, 75524874, 0, 143635866, 220808901, 0, 14557221, 185958081, 0, 180438825, 320588085, 0, 499478574, 29105421, 0, 37340766, 1169275746, 0, 2051928486, 27069021, 0, 971311320
Offset: 2

Views

Author

Derek Orr, Oct 03 2014

Keywords

Comments

a(19) > 155*10^6.
For n == 2 (mod 3), k^n + k + 1 is divisible by k^2 + k + 1. Thus, for n > 2, if n == 2 (mod 3), a(n) = 0.

Crossrefs

Programs

  • PARI
    a(n)=if(n>2&&n==Mod(2,3),return(0));k=1;while(!ispseudoprime(k^n+k+1)||!ispseudoprime(k^n+k-1)||!ispseudoprime(k^n-k+1)||!ispseudoprime(k^n-k-1),k++);k
    n=2;while(n<100,print1(a(n),", ");n++)

Extensions

a(19)-a(27) from Jon E. Schoenfield, Oct 19 2014
a(28)-a(36) from Jon E. Schoenfield, Oct 22 2014
Showing 1-2 of 2 results.