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

A048636 Primes of the form prime^3 + 2.

Original entry on oeis.org

29, 127, 24391, 357913, 571789, 1442899, 5177719, 18191449, 30080233, 73560061, 80062993, 118370773, 127263529, 131872231, 318611989, 344472103, 440711083, 461889919, 590589721, 756058033, 865523179, 1095912793, 1298596573, 1341919729, 1524845953, 1697936059
Offset: 1

Views

Author

Keywords

Comments

The first terms in the intersection with A092402, i.e., of the form p + 2^3, are (18191449, 1341919729, 2588282119, 3532642669, 16445197009, ...). - M. F. Hasler, Jan 13 2025

Examples

			a(2) = 127 = 5^3 + 2 and 5 is prime.
		

Crossrefs

Cf. A048637.
Cf. A092402 (primes of the form p + 8), A321891 (union of the two); A188764 (primes of the form (product of distinct primes^3) + 2).

Programs

  • Maple
    select(isprime, [ithprime(i)^3+2$i=1..300])[];  # Alois P. Heinz, Jan 13 2025
  • Mathematica
    lst={};Do[s=Prime[n]^3;If[PrimeQ[p=s+2], AppendTo[lst, p]], {n, 6!}];lst (* Vladimir Joseph Stephan Orlovsky, Sep 26 2008 *)
  • PARI
    forprime (p=2,1100,if(isprime(p^3+2),print1(p^3+2,", "))) \\ Hugo Pfoertner, Oct 30 2018

A240110 Primes p such that p+2 and p^3+2 are also prime.

Original entry on oeis.org

3, 5, 29, 71, 311, 419, 431, 1031, 1091, 1151, 1451, 1931, 2339, 3371, 3461, 4001, 4421, 4799, 5651, 6269, 6551, 6569, 6761, 6779, 6869, 7559, 7589, 8219, 9011, 9281, 10301, 11069, 11489, 11549, 12161, 12239, 12251, 12539, 14081, 15641, 17189, 18059, 18119, 18521
Offset: 1

Views

Author

K. D. Bajpai, Apr 01 2014

Keywords

Comments

All the terms in the sequence, except a(1), are congruent to 2 mod 3.

Crossrefs

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[2200]],AllTrue[{#+2,#^3+2},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 14 2017 *)
  • PARI
    s=[]; forprime(p=2, 20000, if(isprime(p+2) && isprime(p^3+2), s=concat(s, p))); s \\ Colin Barker, Apr 01 2014

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

A132281 Noncomposites in A067200. Noncomposites (0, 1) and primes p such that A084380(p) = p^3 + 2 is prime.

Original entry on oeis.org

0, 1, 3, 5, 29, 71, 83, 113, 173, 263, 311, 419, 431, 491, 503, 509, 683, 701, 761, 773, 839, 911, 953, 1031, 1091, 1103, 1151, 1193, 1259, 1283, 1373, 1451, 1523, 1583, 1601, 1733, 1823, 1889, 1931, 2099, 2153, 2213, 2273, 2339, 2351, 2441, 2531, 2543
Offset: 1

Views

Author

Jonathan Vos Post, Aug 16 2007

Keywords

Comments

The corresponding near-cube primes are A132282. Analog of near-square primes. After a(1) = 0, all values must be odd. Numbers of the form n^2+2 for n=1, 2, ... are 3, 6, 11, 18, 27, 38, 51, 66, 83, 102, ... (A059100). These are prime for indices n = 1, 3, 9, 15, 21, 33, 39, 45, 57, 81, 99, ... (A067201), corresponding to the near-square primes 3, 11, 83, 227, 443, 1091, 1523, 2027, ... (A056899). Helfgott proves with minor conditions that: "Let f be a cubic polynomial. Then there are infinitely many primes p such that f(p) is squarefree." Note that 47^3 + 2 = 103825 = 5^2 * 4153 and similarly 97^3 + 2 is divisible by 5^2, but otherwise an infinite number of p^3+2 are squarefree.

Examples

			a(1) = 0 because 0^3 + 2 = 2 is prime and 0 is noncomposite.
a(2) = 1 because 1^3 + 2 = 5 is prime and 1 is noncomposite.
a(3) = 3 because 3^3 + 2 = 29 is prime and 3 is prime.
a(4) = 5 because 5^3 + 2 = 127 is prime and 5 is prime.
a(5) = 29 because 29^3 + 2 = 24391 is prime.
45 is not in the sequence because, although 45^3 + 2 = 91127 is prime, 45 is not prime.
63 is not in the sequence because, although 63^3 + 2 = 250049 is prime, 63 is not prime.
65 is not in the sequence because, although 65^3 + 2 = 274627 is prime, 65 is not prime.
a(6) = 71 because 71^3 + 2 = 357913 is prime.
a(7) = 83 because 83^3 + 2 = 571789 is prime.
a(8) = 113 because 113^3 + 2 = 1442899 is prime.
123 is not in the sequence because, although 123^3 + 2 = 1860869 is prime, 123 is not prime.
		

Crossrefs

Formula

{p in A000040 such that A067200(p) = A084380(p) = p^3 + 2 is in A000040}.
Union of {0,1} and A048637. - R. J. Mathar, Oct 18 2007

Extensions

More terms from R. J. Mathar, Oct 18 2007

A261536 Primes p such that p^5 + 2 is also prime.

Original entry on oeis.org

11, 149, 179, 197, 281, 317, 389, 401, 419, 491, 509, 587, 977, 1019, 1217, 1289, 1367, 1499, 1607, 1637, 2039, 2111, 2339, 2459, 2609, 2801, 2897, 3119, 3221, 3359, 3701, 3767, 3917, 4451, 4517, 4871, 5237, 5531, 5717, 5879, 5927, 6197, 6311, 6959, 7151
Offset: 1

Views

Author

Vincenzo Librandi, Aug 24 2015

Keywords

Comments

Subsequence of primes of A216976. - Michel Marcus, Aug 24 2015
All terms == 5 (mod 6). - Robert Israel, Sep 22 2019

Examples

			11^5 + 2 = 161053 is a prime.
		

Crossrefs

Cf. primes p such that p^k+2 is also prime: A001359 (k=1), A048637 (k=3), this sequence (k=5), A261537 (k=7), A261538 (k=9).
Cf. A000040.

Programs

  • Magma
    [p: p in PrimesUpTo(12000) | IsPrime(p^5+2)];
  • Maple
    filter:= proc(p) isprime(p) and isprime(p^5+2) end proc:
    select(filter, [seq(i,i=5..10000,6)]); # Robert Israel, Sep 22 2019
  • Mathematica
    Select[Prime[Range[1000]], PrimeQ[#^5 + 2] &]

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 *)

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
Showing 1-7 of 7 results.