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-6 of 6 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

A242517 List of primes p for which p^n - 2 is prime for n = 1, 3, and 5.

Original entry on oeis.org

31, 619, 2791, 4801, 15331, 33829, 40129, 63421, 69151, 98731, 127291, 142789, 143569, 149971, 151849, 176599, 184969, 201829, 210601, 225289, 231841, 243589, 250951, 271279, 273271, 277549, 280591, 392269, 405439, 441799, 472711, 510709, 530599, 568441, 578689
Offset: 1

Views

Author

Abhiram R Devesh, May 17 2014

Keywords

Examples

			31 is in the sequence because
p = 31 (prime),
p - 2 = 29 (prime),
p^3 - 2 = 29789 (prime), and
p^5 - 2 = 28629149 (prime).
		

Crossrefs

Intersection of A006512, A178251 and A154834, hence, intersection of A240126 and A154834.
Cf. A001359.

Programs

  • Mathematica
    Select[Range[600000], PrimeQ[#] && AllTrue[#^{1, 3, 5} - 2, PrimeQ] &] (* Amiram Eldar, Apr 06 2020 *)
  • PARI
    isok(p) = isprime(p) && isprime(p-2) && isprime(p^3-2) && isprime(p^5-2); \\ Michel Marcus, Apr 06 2020
    
  • PARI
    list(lim)=my(v=List(),p=29); forprime(q=31,lim, if(q-p==2 && isprime(q^3-2) && isprime(q^5-2), listput(v,q)); p=q); Vec(v) \\ Charles R Greathouse IV, Apr 06 2020
  • Python
    import sympy
    n=2
    while n>1:
        n1=n-2
        n2=((n**3)-2)
        n3=((n**5)-2)
        ##Check if n1, n2 and n3 are also primes.
        if sympy.ntheory.isprime(n1)== True and sympy.ntheory.isprime(n2)== True and sympy.ntheory.isprime(n3)== True:
            print(n, " , " , n1, " , ", n2, " , ", n3)
        n=sympy.ntheory.nextprime(n)
    

A268594 Numbers n of the form p^k - k = q^i - i for primes p < q.

Original entry on oeis.org

2, 12, 58, 238, 3120, 6856, 29788, 50650, 65520, 161046, 262126, 300760, 1295026, 3442948, 9393928, 13997518, 21253930, 49430860, 84604516, 95443990, 237176656, 329939368, 384240580, 487443400, 633839776, 893871732, 904231060, 1284365500, 1605723208, 3183010108, 3301293166, 3588604288, 3936827536
Offset: 1

Views

Author

Jud McCranie, Feb 07 2016

Keywords

Examples

			50650 = 37^3-3 = 50651^1-1.
		

Crossrefs

See A268595 for values of p and A268596 for values of q.
Cf. A178251.

Programs

  • PARI
    is(n)=my(p);sum(e=1,logint(n,2)+1,ispower(n+e,e,&p)&&isprime(p))>1 \\ Charles R Greathouse IV, Feb 08 2016
    
  • PARI
    list(lim)=my(v=List([2]),q,n); for(e=3,logint(1+lim\=1,2), forprime(p=2, sqrtnint(lim+e,e), if(sum(i=1,e-1, n=p^e-e; ispower(n+i,i,&q) && isprime(q)), listput(v,n)))); Set(v) \\ Charles R Greathouse IV, Feb 08 2016

A242979 Primes p such that p^3-2 and p^2-2 are both primes.

Original entry on oeis.org

19, 37, 211, 727, 2287, 4507, 4951, 5857, 6217, 6337, 7237, 8329, 8629, 8941, 9127, 9319, 9721, 11467, 12109, 13411, 13831, 15331, 15661, 17029, 17971, 17989, 19489, 21169, 23431, 24439, 24907, 25849, 26161, 31387, 33151, 34039, 34897, 36451, 37441, 37879
Offset: 1

Views

Author

K. D. Bajpai, May 28 2014

Keywords

Comments

Intersection of A062326 and A178251.

Examples

			19 is prime and appears in the sequence because [19^3-2 = 6857] and [19^2-2 = 359] are both primes.
37 is prime and appears in the sequence because [37^3-2 = 50651] and [37^2-2 = 1367] are both primes.
		

Crossrefs

Programs

  • Maple
    with(numtheory):A242979:= proc() local p; p:=ithprime(n); if isprime(p^3-2) and isprime(p^2-2)then RETURN (p); fi; end: seq( A242979 (), n=1..5000);
  • Mathematica
    c = 0; t=Prime[n]; Do[If[PrimeQ[t^3 - 2] && PrimeQ[t^2 - 2], c++; Print[c,"  ",t]], {n,1,3*10^6}];

A243222 Primes p such that p^3 - 2 and p^2 - 2 are both semiprimes.

Original entry on oeis.org

11, 17, 41, 79, 199, 307, 331, 349, 379, 613, 643, 661, 673, 701, 769, 877, 883, 947, 1049, 1249, 1279, 1301, 1319, 1381, 1423, 1483, 1543, 1559, 1609, 1667, 1699, 1759, 1777, 1801, 1831, 1871, 1993, 2011, 2083, 2347, 2539, 2621, 2671, 2687, 2777, 2833, 2861
Offset: 1

Views

Author

K. D. Bajpai, Jun 01 2014

Keywords

Comments

Similar sequence for primes is A242979.
Intersection of A241716 and A242260.

Examples

			11 is prime and appears in the sequence because [ 11^3 - 2 = 1329 = 3 * 443 ] and [ 11^2 - 2 = 119 = 7 * 17 ] are both semiprimes.
17 is prime and appears in the sequence because [ 17^3 - 2 = 4911 = 3 * 1637 ] and [ 17^2 - 2 = 287 = 7 * 41 ] are both semiprimes.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A243222:= proc() local p; p:=ithprime(n); if bigomega(p^3-2)=2 and bigomega(p^2-2) =2 then RETURN (p);  fi; end: seq( A 243222 (), n=1..1000);
  • Mathematica
    A243222 = {}; Do[t = Prime[n]; If[PrimeOmega[t^3 - 2] == 2 && PrimeOmega[t^2 - 2] == 2, AppendTo[A243222, t]], {n, 1000}]; A243222
  • PARI
    s=[]; forprime(p=2, 3000, if(bigomega(p^2-2)==2 && bigomega(p^3-2)==2, s=concat(s, p))); s \\ Colin Barker, Jun 03 2014

A258572 Primes p such that p - 2, p^2 - 2, p^3 - 2, p^4 - 2 and p^5 - 2 are all prime.

Original entry on oeis.org

15331, 3049201, 9260131, 10239529, 10955449, 24303469, 33491569, 42699721, 56341711, 66241561, 87068479, 114254629, 129783571, 143927419, 152065549, 221977909, 235529419, 252769399, 280028449, 284535481, 299116021, 312896359, 349665889, 361039519, 407462929
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 03 2015

Keywords

Comments

Intersection of A006512, A062326, A178251, A154832 and A154834.
Subsequence of primes of A216945. - Michel Marcus, Jul 07 2015

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(40000000) | IsPrime(p^1-2) and IsPrime(p^2-2) and IsPrime(p^3-2) and IsPrime(p^4-2) and IsPrime(p^5-2)];
    
  • Mathematica
    Select[Prime[Range[10^8]], And@@PrimeQ[{#, # - 2, #^2 - 2, #^3 - 2, #^4 - 2, #^5 - 2}] &] (* Vincenzo Librandi, Jul 06 2015 *)
    Select[Prime[Range[2172*10^4]],AllTrue[#^Range[5]-2,PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 02 2018 *)
  • PARI
    first(m)=my(v=vector(m),i,p,t=1);for(i=1,m,while(1,p=prime(t);if(isprime(p-2)&&isprime(p^2 - 2)&&isprime(p^3 - 2)&&isprime(p^4 - 2)&&isprime(p^5 - 2),v[i]=p;break,t++));t++);v; /* Anders Hellström, Jul 17 2015 */

Extensions

a(10) corrected and a(14)-a(25) added by Giovanni Resta, Jun 05 2015
Showing 1-6 of 6 results.