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.

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

A237423 Primes p such that prime(prime(p^2)) - 2 is also prime.

Original entry on oeis.org

13, 17, 167, 179, 211, 223, 337, 373, 541, 661, 743, 751, 1063, 1129, 1217, 1607, 1697, 1741, 1913, 2017, 2039, 2083, 2293, 2389, 2447, 2459, 2543, 2677, 2693, 2711, 2851, 2909, 3083, 3191, 3209, 3259, 3571, 3889, 3917
Offset: 1

Views

Author

K. D. Bajpai, Feb 07 2014

Keywords

Examples

			13 is prime and appears in the sequence because  prime(prime(13^2)) - 2  = 8009 which is also prime.
17 is prime and appears in the sequence because  prime(prime(17^2)) - 2  = 16139 which is also prime.
		

Crossrefs

Programs

  • Maple
    KD := proc() local a,b;  a:=ithprime(n);  b:=ithprime(ithprime(a^2))-2;  if isprime (b) then RETURN (a); fi;  end: seq(KD(), n=1..500);
  • Mathematica
    p[n_] := PrimeQ[Prime[Prime[n^2]] - 2]; n = 0; Do[If[p[Prime[m]], n = n + 1; Print[n, " ", Prime[m]]], {m, 1000}] (* Bajpai *)
    Select[Prime[Range[105]], PrimeQ[Prime[Prime[#^2]] - 2] &] (* Wouter Meeussen, Feb 09 2014 *)

A238185 Primes p such that prime(prime(p^2)) + 2 is also prime.

Original entry on oeis.org

2, 23, 97, 163, 463, 491, 557, 659, 677, 977, 1033, 1151, 1187, 1429, 1439, 1511, 1579, 1663, 1933, 2111, 2113, 2141, 2381, 2969, 3301, 3491, 3803, 3929, 4201, 4421, 4447, 4513, 4547, 4789, 5039, 5273, 5281, 5303, 5309, 5449, 5669, 5741, 5939, 5981, 6053
Offset: 1

Views

Author

K. D. Bajpai, Feb 19 2014

Keywords

Examples

			23 is in the sequence because 23 is prime and prime(prime(23^2)) + 2 = 35803 is also prime.
97 is in the sequence because 97 is prime and prime(prime(97^2)) + 2 = 1269643 is also prime.
		

Crossrefs

Programs

  • Maple
    KD := proc() local a,b,d; a:=ithprime(n); b:=ithprime(ithprime(a^2))+2; if isprime (b) then RETURN (a);fi; end: seq(KD(), n=1..300);
  • Mathematica
    n=0; Do[If[PrimeQ[Prime[Prime[Prime[k]^2]]+2],n=n+1; Print[n," ",Prime[k]]], {k,1,5000}]
    Select[Prime[Range[800]],PrimeQ[Prime[Prime[#^2]]+2]&] (* Harvey P. Dale, Dec 19 2014 *)
Showing 1-4 of 4 results.