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.

A242327 Primes p for which (p^n) + 2 is prime for n = 1, 3, 5, and 7.

Original entry on oeis.org

132749, 1175411, 3940799, 5278571, 11047709, 12390251, 15118769, 21967241, 22234871, 26568929, 31809959, 32229341, 32969591, 35760551, 38704661, 43124831, 43991081, 49248971, 50227211, 51140861, 53221631, 55568171, 59446109, 63671651, 71109161, 76675589
Offset: 1

Views

Author

Abhiram R Devesh, May 10 2014

Keywords

Comments

Subsequence of A001359 and A048637.

Examples

			p = 132749 (prime);
p + 2 = 132751 (prime);
p^3 + 2 = 2339342304585751 (prime);
p^5 + 2 = 41224584878413873150038751 (prime);
p^7 + 2 = 726471878470342746448722269536491751 (prime).
		

Crossrefs

Programs

  • PARI
    isok(p) = isprime(p) && isprime(p+2) && isprime(p^3+2) && isprime(p^5+2) && isprime(p^7+2); \\ Michel Marcus, May 15 2014
    
  • Python
    import sympy
    from sympy.ntheory import isprime, nextprime
    n=2
    while True:
        n1=n+2
        n2=n**3+2
        n3=n**5+2
        n4=n**7+2
        ##.Check if n1, n2, n3 and n4 are also primes
        if all(isprime(x) for x in [n1, n2, n3, n4]):
            print(n, ", ", n1, ", ", n2, ", ", n3, ", ", n4)
        n=nextprime(n)
    
  • Sage
    def is_A242327(n):
        return is_prime(n) and all([is_prime(n^(2*k+1)+2) for k in range(4)])
    filter(is_A242327, range(3940800)) # Peter Luschny, May 15 2014