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.

A243780 Primes p for which p^i + 4 is prime for i = 1, 3 and 5.

Original entry on oeis.org

7, 5503, 8779, 14629, 15877, 21013, 23599, 51199, 61483, 70237, 78163, 79333, 80149, 96667, 113089, 113359, 133153, 140053, 149377, 150889, 184039, 198967, 228199, 251287, 255637, 295843, 301123, 303613, 356929, 382843, 385393, 393709, 420037, 457363, 458119
Offset: 1

Views

Author

Abhiram R Devesh, Jun 10 2014

Keywords

Comments

This is a subsequence of:
A023200: Primes p such that p + 4 is also prime.
A243583: Primes p for which p + 4 and p^3 + 4 are prime.

Examples

			p=7 is in this sequence as p + 4, p^3 + 4, p^5 + 4 (11, 347, 16811) are all prime.
p=5503 is in this sequence as p + 4 = 5507 (prime), p^3 + 4 = 166647398531 (prime) and p^5 + 4 = 5046584669419727747 (prime).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[500000], PrimeQ[#] && AllTrue[#^{1, 3, 5} + 4, PrimeQ] &] (* Amiram Eldar, Apr 04 2020 *)
  • PARI
    s=[]; forprime(p=2, 200000, if(isprime(p+4) && isprime(p^3+4) && isprime(p^5+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)
        n3=((n**5)+4)
        ##Check if n1 , n2 and n3 are also primes.
        if snt.isprime(n1)== True and snt.isprime(n2)== True and snt.isprime(n3)== True:
            print(n,n1,n2,n3)
        n=snt.nextprime(n)
    

A243734 Primes p for which p + 4, p^2 + 4 and p^3 + 4 are primes.

Original entry on oeis.org

3, 7, 103, 277, 487, 967, 4783, 5503, 5923, 8233, 21013, 26317, 27943, 41593, 55213, 78307, 78853, 86197, 89653, 94723, 99013, 123727, 148153, 157177, 166627, 172867, 177883, 179107, 185893, 192883, 194713, 203767, 204517, 223633, 225217, 227593, 236893
Offset: 1

Views

Author

Abhiram R Devesh, Jun 09 2014

Keywords

Comments

This is a subset of the sequences:
A023200: Primes p such that p + 4 is also prime.
A243583: Primes p for which p + 4 and p^3 + 4 are primes.
p is either 2 mod 5 or 3 mod 5, hence p^4 + 4 is 0 mod 5.

Examples

			p = 3 is in this sequence because p + 4 = 7, p^2 + 4 = 13 and p^3 + 4 = 31 are all primes.
p  : p+4,  p^2+4,     p^3+4
7  :  11,     53,       347
103: 107,  10613,   1092731
277: 281,  76733,  21253937
487: 491, 237173, 115501307
		

Crossrefs

Programs

  • PARI
    s=[]; forprime(p=2, 200000, if(isprime(p+4) && isprime(p^2+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 and n < 10**6:
        n1=n+4
        n2=((n**2)+4)
        n3=((n**3)+4)
        ##Check if n1, n2 and n3 are also primes.
        if snt.isprime(n1)== True and snt.isprime(n2)== True and snt.isprime(n3)== True:
            print(n, end=', ')
        n=snt.nextprime(n)
    

A243861 Primes p for which p^i - 4 is prime for i = 1, 3, 5 and 7.

Original entry on oeis.org

971, 12641, 205607, 228341, 276557, 412343, 1012217, 1101323, 1902881, 2171021, 2477411, 2692121, 4116377, 4311677, 6060953, 6182993, 6388913, 6444863, 8341121, 8551451, 9507527, 10523141, 10997411, 11444093, 14101361, 14656307, 14813147, 15435587, 17337521
Offset: 1

Views

Author

Abhiram R Devesh, Jun 12 2014

Keywords

Comments

Subsequence of A243818: Primes p for which p^i - 4 is prime for i = 1, 3 and 5.

Examples

			Prime p=971 is in this sequence because p-4 = 967 (prime), p^3-4 = 915498607 (prime),  p^5-4 = 863169625893847 (prime), and p^7-4 = 813831713247384370687 (prime).
		

Crossrefs

Programs

  • Python
    import sympy.ntheory as snt
    n=2
    while n>1:
        n1=n-4
        n2=((n**3)-4)
        n3=((n**5)-4)
        n4=((n**7)-4)
        ##Check if n1 , n2, n3 and n4 are also primes.
        if snt.isprime(n1)== True and snt.isprime(n2)== True and snt.isprime(n3)== True and snt.isprime(n4)== True:
            print(n, n1, n2, n3, n4)
        n=snt.nextprime(n)

A243859 Primes p for which p^i + 4 is prime for i = 1, 3, 5 and 7.

Original entry on oeis.org

7, 133153, 184039, 356929, 469363, 982843, 2154487, 2552713, 2686573, 3378103, 3847867, 4270069, 4341373, 4564363, 4584847, 4964899, 5366017, 5600989, 6185173, 6592609, 6595597, 6629683, 6768409, 8232277, 9028429, 9964177, 10009339, 12107089, 13266553, 13600189
Offset: 1

Views

Author

Abhiram R Devesh, Jun 12 2014

Keywords

Comments

This is a subsequence of A243780: Primes p for which p^i + 4 is prime for i = 1, 3 and 5.

Examples

			p=7 is in this sequence as p + 4 = 11 (prime), p^3 + 4 = 347 (prime), p^5 + 4 = 16811 (prime), and p^7 + 4 = 823547 (prime).
		

Crossrefs

Programs

  • Maple
    p := 2:
    for  n from 1 do
        if isprime(p+4) and isprime(p^3+4) and isprime(p^5+4) and isprime(p^7+4) then
            print(p) ;
        end if;
        p := nextprime(p) ;
    end do: # R. J. Mathar, Jun 13 2014
  • Mathematica
    Select[Prime[Range[900000]],AllTrue[#^{1,3,5,7}+4,PrimeQ]&] (* Harvey P. Dale, Apr 12 2022 *)
  • Python
    import sympy.ntheory as snt
    n=2
    while n>1:
        n1=n+4
        n2=((n**3)+4)
        n3=((n**5)+4)
        n4=((n**7)+4)
        ##Check if n1 , n2, n3 and n4 are also primes.
        if snt.isprime(n1)== True and snt.isprime(n2)== True and snt.isprime(n3)== True and snt.isprime(n4)== True:
            print(n, n1, n2, n3, n4)
        n=snt.nextprime(n)
Showing 1-4 of 4 results.