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

A240126 Primes p such that p - 2 and p^3 - 2 are also prime.

Original entry on oeis.org

19, 31, 109, 151, 241, 619, 859, 1489, 1951, 2131, 2791, 2971, 3559, 4129, 4651, 4789, 4801, 5659, 6661, 6781, 7591, 8221, 8629, 8821, 8971, 9241, 9721, 9931, 10891, 11971, 12109, 12541, 13831, 14011, 15271, 15289, 15331, 16831, 17029, 17419, 17839, 17989, 18121, 18541, 20149, 20899, 21019
Offset: 1

Views

Author

K. D. Bajpai, Apr 01 2014

Keywords

Comments

All the terms in the sequence are congruent to 1 mod 3.

Examples

			19 is in the sequence because 19 is a prime: 19 - 2 = 17 and 19^3 - 2 = 6857 are also prime.
151 is in the sequence because 151 is a prime: 151 - 2 = 149 and 151^3 - 2 = 3442949 are also prime.
		

Crossrefs

Intersection of A006512 and A178251.

Programs

  • Maple
    KD := proc() local a,b,d; a:=ithprime(n); b:=a-2; d:=a^3-2;  if isprime(b)and isprime(d) then RETURN (a); fi; end: seq(KD(), n=1..10000);
  • Mathematica
    Select[Prime[Range[2000]], PrimeQ[# - 2] && PrimeQ[#^3 - 2] &]
  • PARI
    s=[]; forprime(p=2, 22000, if(isprime(p-2) && isprime(p^3-2), s=concat(s, p))); s \\ Colin Barker, Apr 02 2014

A242326 Primes p for which p + 2, p^3 + 2 and p^5 + 2 are prime.

Original entry on oeis.org

419, 2339, 14081, 45821, 46349, 51419, 56039, 68489, 70379, 108191, 112601, 115319, 131891, 132749, 256391, 267611, 278879, 314159, 328511, 342449, 361001, 385139, 424841, 433259, 470651, 489689, 519371, 573761, 664691, 691181, 694271
Offset: 1

Views

Author

Abhiram R Devesh, May 10 2014

Keywords

Comments

Subsequence of A001359 and A048637.
All the terms in the sequence are congruent to 2 mod 3. This sequence is a subsequence of A240110.
Also, congruent to (11, 29) mod 30. - Zak Seidov, May 18 2014
Also, subsequence of A216976. - Michel Marcus, May 18 2014

Examples

			419 is in the sequence because
p = 419 (prime),
p + 2 = 421 (prime),
p^3 + 2 = 73560061 (prime), and
p^5 + 2 = 12914277518101 (prime).
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(10^6)| IsPrime(p+2) and IsPrime(p^3+2)and IsPrime(p^5+2)]; // Vincenzo Librandi, May 11 2014
  • Mathematica
    Select[Prime[Range[10^5]], PrimeQ[# + 2]&& PrimeQ[#^3 + 2]&& PrimeQ[#^5 + 2] &] (* Vincenzo Librandi, May 11 2014 *)

A242886 Smallest prime p_n which generates n primes of the form (p^i + 2) where i represents the first n odd numbers.

Original entry on oeis.org

3, 3, 419, 132749, 514664471, 1164166301, 364231372931
Offset: 1

Views

Author

Abhiram R Devesh, May 25 2014

Keywords

Comments

The first 4 entries of this sequence are the first entry of the following sequences:
a. A001359: Lesser of twin primes.
b. A240110: Primes p such that p + 2 and p^3 + 2 are also prime.
c. A242326: Primes p for which p + 2, p^3 + 2, and p^5 + 2 are also prime.
d. A242327: Primes p for which (p^n) + 2 is prime for n = 1, 3, 5, and 7.
a(8) > 10^14. - Bert Dobbelaere, Aug 31 2020

Examples

			For n = 1, p = 3 generates primes of the form p^n + 2; for i = 1,
   p + 2 = 5 (prime).
For n = 2, p = 3 generates primes of the form p^n + 2; for i = 1 and 3,
   p + 2 = 5 (prime) and p^3 + 2 = 29 (prime).
For n = 3, p = 419 generates primes of the form p^n + 2; for i = 1, 3, and  5, p + 2 = 421 (prime), p^3 + 2 = 73560061 (prime), and p^5 + 2 = 12914277518101 (prime).
		

Crossrefs

Programs

  • Python
    import sympy
    ## isp_list returns an array of true/false for prime number test for a
    ## list of numbers
    def isp_list(ls):
        pt=[]
        for a in ls:
            if sympy.ntheory.isprime(a)==True:
                pt.append(True)
        return(pt)
    co=1
    while co < 7:
        al=0
        n=2
        while al!=co:
            d=[]
            for i in range(0,co):
                d.append(int(n**((2*i)+1))+2)
            al=isp_list(d).count(True)
            if al==co:
                ## Prints prime number and its corresponding sequence d
                print(n,d)
            n=sympy.ntheory.nextprime(n)
        co=co+1

Extensions

a(7) from Bert Dobbelaere, Aug 30 2020
Showing 1-3 of 3 results.