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.

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