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

A243583 Primes p for which p + 4 and p^3 + 4 are primes.

Original entry on oeis.org

3, 7, 19, 79, 103, 109, 277, 379, 487, 967, 1489, 1663, 1867, 2857, 3019, 3253, 3613, 3697, 4003, 4783, 4969, 5413, 5437, 5503, 5569, 5647, 5923, 7477, 7669, 7687, 7699, 7789, 7933, 8233, 8779, 9007, 9319, 9547, 9739, 10597, 11257, 11467, 11593, 11827, 12037
Offset: 1

Views

Author

Abhiram R Devesh, Jun 09 2014

Keywords

Comments

This is a subsequence of:
A023200: Primes p such that p + 4 is also prime.
A073573: Numbers n such that n^3 + 4 is prime.

Examples

			p = 3 is in this sequence because p + 4 = 7  (prime) and p^3 + 4 = 31 (prime).
p = 7 is in this sequence because p + 4 = 11  (prime) and p^3 + 4 = 347 (prime).
		

Crossrefs

Programs

  • PARI
    s=[]; forprime(p=2, 20000, if(isprime(p+4) && isprime(p^3+4), s=concat(s, p))); s \\ Colin Barker, Jun 11 2014
  • Python
    import sympy.ntheory as snt
    n=2
    while n>1:
        n1=n+4
        n2=((n**3)+4)
        ##Check if n1 and n2 are also primes.
        if snt.isprime(n1)== True and snt.isprime(n2)== True:
            print(n, " , " , n1, " , ", n2)
        n=snt.nextprime(n)
    

A246519 Primes p such that 4+p, 4+p^2, 4+p^3 and 4+p^5 are all prime.

Original entry on oeis.org

7, 5503, 21013, 301123, 303613, 420037, 469363, 679153, 771427, 991957, 999667, 1524763, 1707367, 2030653, 2333083, 2540563, 2552713, 2710933, 3009967, 3378103, 3441817, 3592213, 4419937, 4704613, 4840723, 5177797, 5691547, 6227587, 6275887, 6395677, 6595597, 6597163
Offset: 1

Views

Author

Zak Seidov, Aug 28 2014

Keywords

Comments

For even k > 2, 4 + n^k is prime only for n = 1.
From Derek Orr, Aug 28 2014 (edited by Danny Rorabaugh, Apr 19 2015): (Start)
4+p^4 is composite for all primes p. For p = 2, 4+p^4 = 20 is composite. To prove it for odd primes, consider S(n) = 4+(2*n+1)^4. S(n) == 0 (mod 5) unless n == 2 (mod 5). If n == 2 (mod 5), then 2*n+1 == 0 (mod 5), which is only prime for n = 2; this gives p = 5 and 4+5^4 = 629 is composite. For other odd primes p, 4+p^4 is greater than 5 and divisible by 5.
4+p^(4*m) is also composite for any prime p and integer m > 0. For each m, the proof is the same as above.
(End)
All terms are == {3,7} (mod 10). - Zak Seidov, Aug 29 2014

Examples

			From _K. D. Bajpai_, Jan 20 2015: (Start)
a(2) = 5503:
4 + 5503 = 5507;
4 + 5503^2 = 30283013;
4 + 5503^3 = 166647398531;
4 + 5503^5 = 5046584669419727747;
all five are prime.
(End)
		

Crossrefs

Primes p such that 4+p^7, 4+p^9 and 4+p^11 are also prime is A253937. - K. D. Bajpai, Jan 20 2015
The subsequence with 4+p^7 also prime is A246562. - Danny Rorabaugh, Apr 19 2015

Programs

  • Magma
    [p: p in PrimesUpTo(2*10^7) | IsPrime(4+p) and IsPrime(4+p^2) and IsPrime(4+p^3) and IsPrime(4+p^5)]; // Vincenzo Librandi, Apr 19 2015
  • Mathematica
    k=4; Select[Prime[Range[1,500000]], PrimeQ[k+#]&&PrimeQ[k+#^2] &&PrimeQ[k+#^3] &&PrimeQ[k+#^5]&]  (*K. D. Bajpai, Jan 20 2015 *)
  • PARI
    for(n=1, 6000000, if(isprime(n) && isprime(4+n) && isprime(4+n^2) && isprime(4+n^3) && isprime(4+n^5), print1(n, ", "))) \\ Colin Barker, Aug 28 2014
    
  • PARI
    p=7; forprime(q=11, 1e8, if(q-p==4 && isprime(4+p^2) && isprime(4+p^3) && isprime(4+p^5), print1(p, ", ")); p=q) \\ Charles R Greathouse IV, Aug 28 2014
    
  • Python
    from sympy import prime, isprime
    A246519_list = [p for p in (prime(n) for n in range(1,10**5)) if all([isprime(4+p**z) for z in (1,2,3,5)])]
    # Chai Wah Wu, Sep 08 2014
    

A246562 Primes p such that 4+p, 4+p^2, 4+p^3, 4+p^5, and 4+p^7 are all prime.

Original entry on oeis.org

7, 469363, 2552713, 3378103, 6595597, 6629683, 39837517, 46024063, 46167307, 97371007, 97629403, 105528217, 136983307, 169483033, 202953613, 213792193, 216520987, 216738043, 221705647, 304033927, 317502193, 359133553
Offset: 1

Views

Author

Zak Seidov, Aug 29 2014

Keywords

Comments

All terms are == {3, 7} mod 10. Subsequence of A246519.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[193*10^5]],AllTrue[#^{1,2,3,5,7}+4,PrimeQ]&] (* Harvey P. Dale, Sep 07 2024 *)
  • PARI
    forprime(p=1,10^9,if(ispseudoprime(4+p) && ispseudoprime(4+p^2) && ispseudoprime(4+p^3) && ispseudoprime(4+p^5) && ispseudoprime(4+p^7), print1(p,", "))) \\ Derek Orr, Aug 30 2014

A201307 Primes of the form k^3+4.

Original entry on oeis.org

5, 31, 347, 733, 6863, 15629, 19687, 91129, 250051, 328513, 493043, 614129, 658507, 970303, 1092731, 1295033, 1520879, 1601617, 2146693, 2352641, 3048629, 4826813, 5359379, 6128491, 7414879, 8869747, 12977879, 21253937, 21717643
Offset: 1

Views

Author

Vincenzo Librandi, Nov 30 2011

Keywords

Crossrefs

Programs

  • Magma
    [a: n in [0..800] | IsPrime(a) where a is n^3+4];
  • Mathematica
    Select[Table[n^3+4,{n,0,7000}],PrimeQ]

A243095 Least integer m > 1 such that 4 + m^n is prime or 1 if only 4 + 1^n is prime.

Original entry on oeis.org

3, 3, 3, 1, 7, 3, 7, 1, 3, 3, 9, 1, 33, 7, 9, 1, 43, 17, 27, 1, 9, 3, 7, 1, 55, 47, 285, 1, 27, 3, 39, 1, 43, 117, 163, 1, 63, 255, 15, 1, 87, 3, 43, 1, 187, 77, 37, 1, 105, 45, 25, 1, 99, 305, 79, 1, 3, 27, 903, 1, 127, 293, 255, 1, 27, 27, 435, 1, 207, 143, 127, 1, 117, 295, 1159, 1, 477
Offset: 1

Views

Author

Zak Seidov, Aug 29 2014

Keywords

Comments

If n is a multiple of 4 then 4 + m^n is prime iff m = 1.
4 + m^(4*x) = (m^(2*x)-2*m^x+2) * (m^(2*x)+2*m^x+2). - Jens Kruse Andersen, Sep 02 2014

Crossrefs

Programs

  • PARI
    a(n)=if(n%4==0,return(1));m=2;while(!ispseudoprime(4+m^n),m++);return(m)
    vector(100,n,a(n)) \\ Derek Orr, Aug 29 2014
Showing 1-5 of 5 results.