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-4 of 4 results.

A236526 Numbers k such that k^3 + k +- 1 are twin primes.

Original entry on oeis.org

3, 15, 18, 21, 39, 87, 117, 120, 135, 243, 360, 366, 381, 426, 429, 615, 642, 723, 879, 1002, 1023, 1170, 1173, 1224, 1458, 1506, 1518, 1530, 1731, 1896, 1920, 1965, 2007, 2025, 2058, 2133, 2160, 2376, 2379, 2382, 2406, 2553, 2577, 2673, 2703, 2727
Offset: 1

Views

Author

Derek Orr, Jan 27 2014

Keywords

Comments

The only prime in this sequence is a(1) = 3.

Examples

			381^3 + 381 +- 1 (55305961 and 55305959, respectively) are both prime. Thus, 381 is a member of this sequence.
		

Crossrefs

Intersection of A049407 and A236475.

Programs

  • Magma
    [n: n in [1..5*10^3] |IsPrime(n^3+n-1) and IsPrime(n^3 +n+1)]; // Vincenzo Librandi, Dec 26 2015
    
  • Mathematica
    Select[Range[3000], PrimeQ[#^3 + # - 1] && PrimeQ[#^3 + # + 1] &] (* Vincenzo Librandi, Dec 26 2015 *)
    Select[Range[3000],AllTrue[#^3+#+{1,-1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Feb 23 2020 *)
  • PARI
    isok(n) = isprime(n^3+n+1) && isprime(n^3+n-1); \\ Michel Marcus, Dec 27 2015
  • Python
    import sympy
    from sympy import isprime
    {print(n) for n in range(10**4) if isprime(n**3+n-1) and isprime(n**3+n+1)}
    

A236764 Numbers k such that k^3 +/- k +/- 1 are prime for all four possibilities.

Original entry on oeis.org

15, 21, 15375, 25164, 53361, 95190, 110685, 115140, 133701, 139425, 140430, 140844, 189336, 217686, 220650, 266916, 272469, 289341, 344880, 364665, 377805, 382221, 390270, 415779, 454905, 539700, 561186, 567645, 575799, 584430, 603651, 722484
Offset: 1

Views

Author

Derek Orr, Jan 30 2014

Keywords

Examples

			110685^3+110685+1 (1356020665779811), 110685^3+110685-1 (1356020665779809), 110685^3-110685+1 (1356020665558441) and 110685^3-110685-1 (1356020665558439) are all prime. Thus 110685 is a member of this sequence.
		

Crossrefs

Intersection of A126421, A236477, A049407, and A236475.

Programs

  • PARI
    for(n=1, 800000, if(isprime(n^3+n+1)&&isprime(n^3-n+1)&&isprime(n^3+n-1)&&isprime(n^3-n-1), print1(n, ","))) \\ Colin Barker, Jan 31 2014
  • Python
    import sympy
    from sympy import isprime
    {print(n) for n in range(10**6) if isprime(n**3+n+1) and isprime(n**3-n+1) and isprime(n**3+n-1) and isprime(n**3-n-1)}
    

A236476 Primes p such that p^3 + p - 1 is prime.

Original entry on oeis.org

3, 7, 43, 73, 103, 109, 127, 139, 151, 199, 223, 241, 283, 313, 367, 379, 421, 541, 631, 661, 733, 739, 751, 769, 829, 991, 1117, 1129, 1201, 1231, 1249, 1297, 1303, 1429, 1471, 1663, 1669, 1693, 1699, 1741, 1789, 1867, 1933
Offset: 1

Views

Author

Derek Orr, Jan 26 2014

Keywords

Comments

Primes in the sequence A236475.

Examples

			241 is prime and 241^3 + 241 - 1 = 13997761 is prime.
		

Crossrefs

Cf. A236475.

Programs

  • PARI
    s=[]; forprime(p=2, 2000, if(isprime(p^3+p-1), s=concat(s, p))); s \\ Colin Barker, Jan 27 2014
  • Python
    import sympy
    from sympy import isprime
    {print(n) for n in range(10**4) if isprime(n) and isprime(n**3+n-1)}
    

A248079 Least number k such that k^n + k - 1 is prime, or 0 if no such k exists.

Original entry on oeis.org

2, 2, 3, 2, 0, 4, 6, 2, 4, 3, 0, 17, 36, 3, 3, 2, 0, 6, 9, 43, 27, 9, 0, 3, 154, 3, 34, 54, 0, 24, 24, 6, 226, 23, 0, 3, 70, 36, 13, 51, 0, 4, 13, 9, 10, 68, 0, 18, 10, 45, 154, 85, 0, 23, 6, 10, 37, 8, 0, 30, 331, 9, 3, 40, 0, 11, 61, 8, 10, 35, 0, 61, 76, 54, 426, 9, 0, 84, 87, 13, 46
Offset: 1

Views

Author

Derek Orr, Sep 30 2014

Keywords

Comments

If n == 5 mod 6 (A016969), k^n + k - 1 is always divisible by k^2 - k + 1. Thus it will never be prime.

Crossrefs

Programs

  • Mathematica
    lnk[n_]:=Module[{k=2},While[CompositeQ[k^n+k-1],k++];k]; Table[If[Mod[n,6] == 5,0,lnk[n]],{n,90}] (* Harvey P. Dale, Oct 24 2021 *)
  • PARI
    a(n)=if(n==Mod(5,6),return(0));k=1;while(!isprime(k^n+k-1),k++);k
    vector(100,n,a(n))
Showing 1-4 of 4 results.