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.

A236760 Numbers n such that n^4 + n +- 1 are twin primes.

Original entry on oeis.org

2, 6, 9, 12, 26, 44, 72, 77, 119, 204, 266, 290, 351, 506, 539, 542, 561, 644, 741, 807, 861, 924, 992, 996, 1016, 1032, 1049, 1356, 1412, 1556, 1640, 1794, 1847, 1862, 1871, 1895, 1980, 2036, 2129, 2222, 2289, 2354, 2445, 2616, 2630
Offset: 1

Views

Author

Derek Orr, Jan 30 2014

Keywords

Examples

			992^4 + 992 + 1 (968381957089) and 992^4 + 992 - 1 (968381957087) are twin primes. Thus, 992 is a member of this sequence.
		

Crossrefs

Intersection of A236759 and A049408.

Programs

  • Magma
    [n: n in [1..5*10^3] |IsPrime(n^4+n-1) and IsPrime(n^4 +n+1)]; // Vincenzo Librandi, Dec 26 2015
  • Mathematica
    Select[Range[3000], PrimeQ[#^4 + # - 1] && PrimeQ[#^4 + # + 1] &] (* Vincenzo Librandi, Dec 26 2015 *)
    Select[Range[3000],AllTrue[#^4+#+{1,-1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Oct 13 2017 *)
  • PARI
    s=[]; for(n=1, 3000, if(isprime(n^4+n+1)&&isprime(n^4+n-+1), s=concat(s, n))); s \\ Colin Barker, Jan 31 2014
    
  • Python
    import sympy
    from sympy import isprime
    {print(n) for n in range(10**4) if isprime(n**4+n-1) and isprime(n**4+n+1)}
    

A236950 Primes p such that p^4+p-1 is prime.

Original entry on oeis.org

2, 3, 13, 17, 23, 31, 43, 157, 229, 293, 353, 373, 397, 409, 463, 521, 577, 619, 727, 743, 857, 883, 953, 1049, 1087, 1123, 1171, 1319, 1409, 1423, 1429, 1459, 1499, 1511, 1543, 1619, 1693, 1847, 1871, 1931, 1951, 1993, 2017, 2029, 2129
Offset: 1

Views

Author

Derek Orr, Feb 01 2014

Keywords

Comments

Primes in the sequence A236759.

Examples

			577 is prime and 577^4 + 577 - 1 = 110841719617 is prime. Thus, 577 is a member of this sequence.
		

Crossrefs

Cf. A236759.

Programs

  • Magma
    [p: p in PrimesUpTo(6000) | IsPrime(p^4+p-1)]; // Vincenzo Librandi, Feb 14 2014
  • Mathematica
    Select[Prime[Range[5000]], PrimeQ[#^4 + # - 1]&] (* Vincenzo Librandi, Feb 14 2014 *)
  • PARI
    s=[]; forprime(p=2, 6000, if(isprime(p^4+p-1), s=concat(s, p))); s \\ Colin Barker, Feb 05 2014
    
  • Python
    import sympy
    from sympy import isprime
    {print(n) for n in range(10**4) if isprime(n) and isprime(n**4+n-1)}
    

A236766 Numbers n such that n^4 +/- n +/- 1 are prime for all four possibilities.

Original entry on oeis.org

6, 9, 7266, 115131, 380529, 536646, 636609, 818526, 922734, 1389015, 1660119, 2045415, 2085726, 2262420, 2469396, 2722260, 2836374, 2954250, 3146904, 3614226, 3949770, 4062465, 4110834, 4211499, 4400100, 5081055, 5324424, 5434794, 5436090
Offset: 1

Views

Author

Derek Orr, Jan 30 2014

Keywords

Examples

			380529^4+380529+1 (20967711831335262645811), 380529^4+380529-1 (20967711831335262645809), 380529^4-380529+1 (20967711831335261884753), and 380529^4-380529-1 (20967711831335261884751) are all prime. Thus, 380529 is a member of this sequence.
		

Crossrefs

Intersection of A236759, A049408, A236761 and A126424.

Programs

  • Mathematica
    Select[Range[55*10^5],AllTrue[#^4+{(#-1),(#+1),(-#-1),(-#+1)},PrimeQ]&] (* Harvey P. Dale, Nov 02 2024 *)
  • PARI
    for(n=1, 5000000, if(isprime(n^4+n+1)&&isprime(n^4-n+1)&&isprime(n^4+n-1)&&isprime(n^4-n-1), print1(n, ","))) \\ Colin Barker, Jan 31 2014
  • Python
    import sympy
    from sympy import isprime
    {print(n) for n in range(10**7) if isprime(n**4+n+1) and isprime(n**4-n+1) and isprime(n**4+n-1) and isprime(n**4-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.