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

A053705 Primes p of form q^k-2 where q is also a prime and k > 1.

Original entry on oeis.org

2, 7, 23, 47, 79, 167, 241, 359, 727, 839, 1367, 1847, 2207, 2399, 3719, 5039, 6857, 7919, 10607, 11447, 14639, 16127, 17159, 19319, 19681, 28559, 29789, 29927, 36479, 44519, 49727, 50651, 54287, 57119, 66047, 85847, 97967, 113567, 128879
Offset: 1

Views

Author

Labos Elemer, Feb 14 2000

Keywords

Examples

			79 = 3^4-2.
241 = 3^5-2.
		

Crossrefs

Subsequence of A267944.

Programs

  • Mathematica
    Do[s=2+Prime[n]; If[Equal[Length[FactorInteger[s]], 1]&&!PrimeQ[s], Print[s-2]], {n, 1, 100000}]
    fQ[n_] := PrimeNu[n + 2] == 1 && ! PrimeQ[n + 2]; Select[ Prime@ Range@ 15000, fQ] (* Robert G. Wilson v, Apr 01 2012 *)
    seq[max_] := Module[{s = {}, p = 2}, While[p^2 <= max, s = Join[s, Select[p^Range[2, Floor[Log[p, max]]], PrimeQ[# - 2] &]]; p = NextPrime[p]]; Union[s] - 2]; seq[150000] (* Amiram Eldar, Aug 27 2024 *)
  • PARI
    lista(nn) = forprime (p=1, nn, if (ispower(p+2,,&q) && isprime(q), print1(p, ", ")); ); \\ Michel Marcus, Dec 11 2014

Formula

a(n) = A053704(n) - 2. - Amiram Eldar, Aug 27 2024

Extensions

Definition corrected by Zak Seidov, Dec 11 2014

A267945 Primes that are a prime power plus two.

Original entry on oeis.org

5, 7, 11, 13, 19, 29, 31, 43, 61, 73, 83, 103, 109, 127, 139, 151, 181, 193, 199, 229, 241, 271, 283, 313, 349, 421, 433, 463, 523, 571, 601, 619, 643, 661, 811, 823, 829, 859, 883
Offset: 1

Views

Author

Robert C. Lyons, Jan 22 2016

Keywords

Comments

The term 'prime power' refers to the elements of A246655.
If we were to extend the definition of prime power to include 1, then 3 would be the first term of the sequence, because 3 = 2^0 + 2.
The sequence is probably infinite, since it includes all the terms of A006512 (Greater of twin primes).
From Robert Israel, Jan 22 2016: (Start)
Since 3 divides p or p^k+2 if k is even, the only terms of the form p^k+2 where k is even are A228034.
All terms not in A057735 are congruent to 1 mod 3.
The generalized Bunyakovsky conjecture implies that for any odd k, there are infinitely many terms of the form p^k+2. (End)

Examples

			5 is in the sequence because 5 = 3^1 + 2.
7 is in the sequence because 7 = 5^1 + 2.
11 is in the sequence because 11 = 3^2 + 2.
13 is in the sequence because 13 = 11^1 + 2.
29 is in the sequence because 29 = 3^3 + 2.
		

Crossrefs

Programs

  • Maple
    select(t -> isprime(t) and nops(numtheory:-factorset(t-2))=1, [ seq(i,i=3..1000, 2)]); # Robert Israel, Jan 22 2016
  • Mathematica
    A267945Q = PrimeQ@# && (Length@# == 1 && #[[1, 1]] > 1 &@FactorInteger[# - 2]) & (* JungHwan Min, Jan 25 2016 *)
    Select[Array[Prime, 100], Length@# == 1 && #[[1, 1]] > 1 &@FactorInteger[# - 2] &] (* JungHwan Min, Jan 25 2016 *)
  • PARI
    lista(nn) = {forprime(p=2, nn, if (isprimepower(p-2), print1(p, ", ")););} \\ Michel Marcus, Jan 22 2016
  • Sage
    filter( is_prime, [ n+2 for n in prime_powers( 1, 1000 ) ] )
    
Showing 1-2 of 2 results.