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-10 of 23 results. Next

A062326 Primes p such that p^2 - 2 is also prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 19, 29, 37, 43, 47, 61, 71, 89, 103, 107, 127, 131, 139, 173, 191, 211, 223, 233, 239, 257, 293, 313, 337, 359, 421, 443, 449, 467, 491, 523, 541, 569, 587, 607, 653, 677, 719, 727, 733, 743, 751, 757, 761, 797, 811, 863, 881, 1013, 1021
Offset: 1

Views

Author

Reiner Martin, Jul 12 2001

Keywords

Comments

When p and p^2 - 2 are both prime, the fundamental solution of the Pell equation x^2 - n*y^2 = 1, for n = p^2 - 2, is x = p^2 - 1 and y = p. See A109748 for the case of n and x both prime. - T. D. Noe, May 19 2007
3 is the only prime p such that p^2 + 2 and p^2 - 2 are both primes. - Jaroslav Krizek, Nov 25 2013 (note that p^2 + 2 is composite for all primes p >= 5. - Joerg Arndt, Jan 10 2015)
For all primes p except for p = 3, p^2 + 2 is multiple of 3 (see A061725). - Zak Seidov, Feb 19 2015

Crossrefs

Cf. A049002 (p^2-2).

Programs

  • Haskell
    import Data.List (elemIndices)
    a062326 = a000040 . a137291
    a062326_list = map (a000040 . (+ 1)) $
                   elemIndices 1 $ map a010051' a049001_list
    -- Reinhard Zumkeller, Jul 30 2015
  • Magma
    [ p: p in PrimesUpTo(1100) | IsPrime(p^2-2) ]; // Klaus Brockhaus, Jan 01 2009
    
  • Mathematica
    Select[Prime[Range[500]], PrimeQ[#^2 - 2] &] (* Harvey P. Dale, Sep 20 2011 *)
  • PARI
    { n=0; forprime (p=2, 5*10^5, if (isprime(p^2 - 2), write("b062326.txt", n++, " ", p); if (n==1000, break)) ) } \\ Harry J. Smith, Aug 05 2009
    

A063637 Primes p such that p+2 is a semiprime.

Original entry on oeis.org

2, 7, 13, 19, 23, 31, 37, 47, 53, 67, 83, 89, 109, 113, 127, 131, 139, 157, 167, 181, 199, 211, 233, 251, 257, 263, 293, 307, 317, 337, 353, 359, 379, 389, 401, 409, 443, 449, 467, 479, 487, 491, 499, 503, 509, 541, 557, 563, 571, 577, 587, 631, 647, 653, 677
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 21 2001

Keywords

Comments

Primes of the form p*q - 2, where p and q are primes.
Union of A049002 and A115093. - T. D. Noe, Mar 01 2006

Examples

			From _K. D. Bajpai_, Sep 06 2014: (Start)
a(3) = 13, which is prime, and 13 + 2 = 15 = 3 * 5, which is a semiprime.
a(4) = 19, which is prime, and 19 + 2 = 21 = 3 * 7, which is a semiprime.
(End)
		

References

  • J.-R. Chen, On the representation of a large even integer as the sum of a prime and a product of at most two primes, Sci. Sinica 16 (1973), 157-176.

Crossrefs

Cf. A109611 (Chen primes).

Programs

  • Haskell
    a063637 n = a063637_list !!(n-1)
    a063637_list = filter ((== 1) . a064911 . (+ 2)) a000040_list
    -- Reinhard Zumkeller, Nov 15 2011
  • Maple
    select(t -> isprime(t) and numtheory:-bigomega(t+2)=2, [2, seq(2*i+1,i=1..500)]); # Robert Israel, Sep 07 2014
  • Mathematica
    f[n_] := Plus @@ Flatten[ Table[ # [[2]], {1}] & /@ FactorInteger[ n]]; Select[ Prime[ Range[ 123]], f[ # + 2] == 2 &] (* Robert G. Wilson v, Apr 30 2005 *)
    Select[Prime[Range[500]],PrimeOmega[#+2]==2&]  (* K. D. Bajpai, Sep 06 2014 *)
  • PARI
    { n=0; for (m=1, 10^9, p=prime(m); if (bigomega(p + 2) == 2, write("b063637.txt", n++, " ", p); if (n==1000, break)) ) } \\ Harry J. Smith, Aug 26 2009
    

Formula

a(n) = A062721(n) - 2.
A010051(a(n)) * A064911(a(n) + 2) = 1. - Reinhard Zumkeller, Nov 15 2011

A049001 a(n) = prime(n)^2 - 2.

Original entry on oeis.org

2, 7, 23, 47, 119, 167, 287, 359, 527, 839, 959, 1367, 1679, 1847, 2207, 2807, 3479, 3719, 4487, 5039, 5327, 6239, 6887, 7919, 9407, 10199, 10607, 11447, 11879, 12767, 16127, 17159, 18767, 19319, 22199, 22799, 24647, 26567, 27887
Offset: 1

Views

Author

Keywords

Comments

Smallest numbers k such that k*prime(n)^2 + 1 is a square. - Bruno Berselli, Apr 19 2013

Crossrefs

Programs

Formula

a(n) = A001248(n) - 2.
a(n) = A182200(n) + 1. - Wesley Ivan Hurt, Oct 11 2013
Product_{n>=1} (1 - 1/a(n)) = A065481. - Amiram Eldar, Nov 07 2022

A237413 Number of ways to write n = k + m with k > 0 and m > 0 such that p(k)^2 - 2, p(m)^2 - 2 and p(p(m))^2 - 2 are all prime, where p(j) denotes the j-th prime.

Original entry on oeis.org

0, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 3, 2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 2, 5, 3, 1, 3, 3, 3, 3, 3, 1, 3, 1, 2, 2, 5, 2, 3, 3, 5, 2, 5, 7, 3, 3, 4, 5, 5, 5, 4, 4, 5, 2, 3, 4, 7, 5, 3, 4, 8, 6, 5, 4, 6, 5, 4, 2, 6, 5, 6, 5, 2, 6, 7
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 07 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1.
This conjecture was motivated by the "Super Twin Prime Conjecture".
See A237414 for primes q with q^2 - 2 and p(q)^2 - 2 both prime.

Examples

			a(7) = 1 since 7 = 6 + 1 with p(6)^2 - 2 = 13^2 - 2 = 167, p(1)^2 - 2 = 2^2 - 2 = 2 and p(p(1))^2 - 2 = p(2)^2 - 2 = 3^2 - 2 = 7 are all prime.
a(516) = 1 since 516 = 473 + 43 with p(473)^2 - 2 = 3359^2 - 2 = 11282879, p(43)^2 - 2 = 191^2 - 2 = 36479 and p(p(43))^2 - 2 = p(191)^2 - 2 = 1153^2 - 2 = 1329407 all prime.
		

Crossrefs

Programs

  • Mathematica
    pq[k_]:=PrimeQ[Prime[k]^2-2]
    a[n_]:=Sum[If[pq[k]&&pq[n-k]&&pq[Prime[n-k]],1,0],{k,1,n-1}]
    Table[a[n],{n,1,80}]

A137291 Numbers m such that prime(m)^2-2 is prime.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 10, 12, 14, 15, 18, 20, 24, 27, 28, 31, 32, 34, 40, 43, 47, 48, 51, 52, 55, 62, 65, 68, 72, 82, 86, 87, 91, 94, 99, 100, 104, 107, 111, 119, 123, 128, 129, 130, 132, 133, 134, 135, 139, 141, 150, 152, 170, 172, 177, 180, 182, 191, 200, 202, 209, 211
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 05 2008

Keywords

Comments

For m>=1, for these and only these numbers m, A242719(m) = prime(m)^2 + 1. Since A242719(m) >= prime(m)^2 + 1, then the equality is obtained on this and only this sequence. - Vladimir Shevelev, Sep 04 2014

Examples

			prime(24)*prime(24)-2 = 89*89-2 = 7919 is prime, so n=24 belongs to the sequence.
		

Crossrefs

Programs

  • Haskell
    a137291 n = a137291_list !! (n-1)
    a137291_list = filter ((== 1) . a010051' . a049001) [1..]
    -- Reinhard Zumkeller, Jul 30 2015
    
  • Mathematica
    Select[Range[211],PrimeQ[Prime[#]^2-2]&] (* James C. McMahon, May 28 2025 *)
  • PARI
    is(n,p=prime(n))=isprime(p^2-2) \\ Charles R Greathouse IV, Feb 17 2017

Formula

A103960(a(n)) - A210481(a(n)) = 1. - Reinhard Zumkeller, Jul 30 2015
a(n) = A049084(A049002(n)). - R. J. Mathar, Apr 09 2008

Extensions

More terms from R. J. Mathar, Apr 09 2008
Offset corrected by Reinhard Zumkeller, Jul 30 2015

A261281 Least positive integer k with prime(k)^2-2 and prime(prime(k))^2-2 both prime such that prime(k*n)^2-2 and prime(prime(k*n))^2-2 are all prime.

Original entry on oeis.org

1, 1, 319, 134, 34, 62, 2, 536, 5215, 15, 3965, 2168, 34, 1, 1, 737, 2, 7075, 3699, 419, 132, 372, 14, 2, 34, 2, 52, 1, 668, 36561, 2, 48, 1239, 1, 401, 1613, 1646, 2472, 43, 31361, 134, 1103, 1, 5374, 6201, 466, 1, 1, 2118, 2, 1646, 1, 1343, 856, 28, 1868, 10324, 360, 2845, 6571, 65, 1, 419, 43, 1, 2, 2, 1, 889, 202
Offset: 1

Views

Author

Zhi-Wei Sun, Aug 14 2015

Keywords

Comments

Conjecture: a(n) exists for any n > 0. In general, any positive rational number r can be written as m/n with m and n in the set {k>0: prime(k)^2-2 and prime(prime(k))^2-2 are both prime}.
This implies that the sequence A237414 has infinitely many terms.

Examples

			a(2) = 1 since prime(1)^2-2 = 2^2-2 = 2, prime(prime(1))^2-2 = prime(2)^2-2 = 3^2-2 = 7, prime(1*2)^2-2 = 3^2-2 = 7, and prime(prime(1*2))^2-2 = prime(3)^2-2 = 5^2-2 = 23 are all prime.
a(3) = 319 since prime(319)^2-2 = 2113^2-2 = 4464767, prime(prime(319))^2-2 = prime(2113)^2-2 = 18443^2-2 = 340144247, prime(319*3)^2-2 = 7547^2-2 = 56957207, and prime(prime(3*319))^2-2 = prime(7547)^2-2 = 76757^2-2 = 5891637047 are all prime.
		

References

  • Zhi-Wei Sun, Problems on combinatorial properties of primes, in: M. Kaneko, S. Kanemitsu and J. Liu (eds.), Number Theory: Plowing and Starring through High Wave Forms, Proc. 7th China-Japan Seminar (Fukuoka, Oct. 28 - Nov. 1, 2013), Ser. Number Theory Appl., Vol. 11, World Sci., Singapore, 2015, pp. 169-187.

Crossrefs

Programs

  • Mathematica
    f[n_]:=Prime[n]
    q[n_]:=PrimeQ[f[n]^2-2]&&PrimeQ[f[f[n]]^2-2]
    Do[k=0;Label[bb];k=k+1;If[q[k]&&q[k*n],Goto[aa],Goto[bb]];Label[aa];Print[n," ", k];Continue,{n,1,70}]
  • PARI
    a(n) = my(k=1); while (!isprime(prime(k)^2-2) || !isprime(prime(prime(k))^2-2) || !isprime(prime(k*n)^2-2) || !isprime(prime(prime(k*n))^2-2), k++); k; \\ Michel Marcus, Aug 14 2015

A238576 Number of odd primes p < 2*n with prime(n*(p-1)/2)^2 - 2 prime.

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 1, 4, 3, 2, 2, 4, 2, 2, 2, 3, 2, 2, 4, 5, 2, 2, 1, 8, 2, 2, 3, 3, 2, 2, 4, 4, 5, 6, 2, 5, 4, 3, 3, 7, 2, 2, 8, 8, 5, 4, 6, 3, 3, 7, 6, 5, 3, 3, 9, 4, 8, 3, 5, 3, 1, 5, 6, 4, 6, 7, 7, 8, 6, 6, 2, 7, 1, 5, 9, 7, 5, 6, 5, 7
Offset: 1

Views

Author

Zhi-Wei Sun, Mar 01 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 1, and a(n) = 1 only for n = 2, 7, 23, 61, 73.
(ii) For any integer n > 1, there is an odd prime p < 2*n with prime(n*(p+1)/2)^2 - 2 prime.
Clearly, either part of the conjecture implies that there are infinitely many primes of the form p^2 - 2 with p prime.

Examples

			a(2) = 1 since 2 and prime(2*(3-1)/2)^2 - 2 = 3^2 - 2 = 7 are both prime.
a(7) = 1 since 5 and prime(7*(5-1)/2)^2 - 2 = 43^2 - 2 = 1847 are both prime.
a(23) = 1 since 29 and prime(23*(29-1)/2)^2 - 2 = 2137^2 - 2 = 4566767 are both prime.
a(61) = 1 since 43 and prime(61*(43-1)/2)^2 - 2 = 10463^2 - 2 = 109474367 are both prime.
a(73) = 1 since 7 and prime(73*(7-1)/2)^2 - 2 = 1367^2 - 2 = 1868687 are both prime.
		

Crossrefs

Programs

  • Mathematica
    p[k_,n_]:=PrimeQ[Prime[(Prime[k]-1)/2*n]^2-2]
    a[n_]:=Sum[If[p[k,n],1,0],{k,2,PrimePi[2n-1]}]
    Table[a[n],{n,1,80}]

A115093 Primes of the form p*q-2, where p and q are distinct primes.

Original entry on oeis.org

13, 19, 31, 37, 53, 67, 83, 89, 109, 113, 127, 131, 139, 157, 181, 199, 211, 233, 251, 257, 263, 293, 307, 317, 337, 353, 379, 389, 401, 409, 443, 449, 467, 479, 487, 491, 499, 503, 509, 541, 557, 563, 571, 577, 587, 631, 647, 653, 677, 683, 701, 719, 743
Offset: 1

Views

Author

T. D. Noe, Mar 01 2006

Keywords

Comments

This sequence is a subset of A063637, which is the union of this sequence and A049002.

Crossrefs

Cf. A049002 (primes of the form p^2-2, where p is prime), A063637 (primes of the form p*q-2 where p and q are primes).

Programs

  • Mathematica
    SemiPrimeQ[n_] := (n>1) && (2==Plus@@(Transpose[FactorInteger[n]][[2]])); Select[Prime[Range[150]], SemiPrimeQ[ #+2] && !IntegerQ[Sqrt[ #+2]]&]

A238701 Number of primes p < n with q = floor((n-p)/4) and q^2 - 2 both prime.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 3, 3, 4, 4, 4, 3, 3, 3, 3, 4, 4, 4, 6, 5, 5, 5, 3, 4, 6, 6, 7, 6, 4, 4, 4, 4, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 4, 4, 6, 6, 4, 5, 5, 5, 7, 6, 6, 6, 5, 5, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 5, 5, 5, 5, 3, 4, 5, 5
Offset: 1

Views

Author

Zhi-Wei Sun, Mar 03 2014

Keywords

Comments

Conjecture: Let m > 0 and n > 2*m + 1 be integers. If m = 1 and 2 | n, or m = 3 and n is not congruent to 1 modulo 6, or m = 2, 4, 5, ..., then there is a prime p < n with q = floor((n-p)/m) and q^2 - 2 both prime.
In the case m = 1, this is a refinement of Goldbach's conjecture. In the case m = 2, this is stronger than Lemoine's conjecture (cf. A046927). The conjecture for m > 2 seems completely new. We view the conjecture as a natural extension of Goldbach's conjecture.

Examples

			a(11) = 2 since 2, floor((11-2)/4)= 2 and 2^2 - 2 are all prime, and 3, floor((11-3)/4) = 2 and 2^2 - 2 are all prime.
		

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=PrimeQ[n]&&PrimeQ[n^2-2]
    p[n_,k_]:=PQ[Floor[(n-Prime[k])/4]]
    a[n_]:=Sum[If[p[n,k],1,0],{k,1,PrimePi[n-1]}]
    Table[a[n],{n,1,80}]

A261354 Primes p such that prime(p)^2 - 2 = prime(q) for some prime q.

Original entry on oeis.org

31, 191, 541, 809, 1153, 1301, 2221, 3037, 3847, 4049, 4159, 5441, 8243, 10177, 12277, 13681, 14783, 15619, 17903, 19463, 20897, 22697, 24517, 25163, 25847, 25849, 26633, 26647, 27329, 27407, 28051, 32653, 35059, 35747, 36341, 36527, 37369, 37811, 38609, 40949, 42737, 46679, 51061, 51607, 54443, 54679, 56113, 57637, 60887, 61493
Offset: 1

Views

Author

Zhi-Wei Sun, Aug 15 2015

Keywords

Comments

Conjecture: The sequence has infinitely many terms. In general, for any integers a,b,c with a>0 and gcd(a,b,c)=1, if b^2-4*a*c is not a square, a+b+c is odd, and gcd(b,a+c) is not divisible by 3, then there are infinitely many prime pairs {p,q} such that a*prime(p)^2+b*prime(p)+c = prime(q).

Examples

			a(1) = 31 since 31 is a prime, and prime(31)^2-2 = 127^2-2 = 16127 = prime(1877) with 1877 prime.
		

References

  • Zhi-Wei Sun, Problems on combinatorial properties of primes, in: M. Kaneko, S. Kanemitsu and J. Liu (eds.), Number Theory: Plowing and Starring through High Wave Forms, Proc. 7th China-Japan Seminar (Fukuoka, Oct. 28 - Nov. 1, 2013), Ser. Number Theory Appl., Vol. 11, World Sci., Singapore, 2015, pp. 169-187.

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=PrimeQ[n]&&PrimeQ[PrimePi[n]]
    f[k_]:=Prime[Prime[k]]^2-2
    n=0;Do[If[PQ[f[k]],n=n+1;Print[n," ",Prime[k]]],{k,1,6200}]
Showing 1-10 of 23 results. Next