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

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
    

A242719 Smallest even k such that lpf(k-3) > lpf(k-1) >= prime(n), where lpf=least prime factor (A020639).

Original entry on oeis.org

10, 26, 50, 170, 170, 362, 362, 842, 842, 1370, 1370, 1850, 1850, 2210, 3722, 3722, 3722, 4892, 5042, 7082, 7922, 7922, 7922, 10610, 10610, 10610, 11450, 13844, 16130, 16130, 17162, 19322, 19322, 24614, 24614, 25592, 29504, 29930, 29930, 36020, 36020
Offset: 2

Views

Author

Vladimir Shevelev, May 21 2014

Keywords

Comments

The sequence is connected with a sufficient condition for the existence of an infinity of twin primes. In contrast to A242489, this sequence is nondecreasing.
All even numbers of the form A062326(n)^2 + 1 are in the sequence. All a(n)-1 are semiprimes. - Vladimir Shevelev, May 24 2014
a(n) <= A242489(n); a(n) >= prime(n)^2+1. Conjecture: a(n) <= prime(n)^4. - Vladimir Shevelev, Jun 01 2014
Conjecture: all numbers a(n)-3 are primes. Peter J. C. Moses verified this conjecture up to a(2001) (cf. with conjecture in A242720). - Vladimir Shevelev, Jun 09 2014

Crossrefs

Programs

  • Mathematica
    lpf[k_] := FactorInteger[k][[1, 1]];
    a[n_] := a[n] = For[k = If[n == 2, 10, a[n-1]], True, k = k+2, If[lpf[k-3] > lpf[k-1] >= Prime[n], Return[k]]];
    Array[a, 50, 2] (* Jean-François Alcover, Nov 06 2018 *)
  • PARI
    lpf(k) = factorint(k)[1,1];
    vector(50, n, k=6; while(lpf(k-3)<=lpf(k-1) || lpf(k-1)Colin Barker, Jun 01 2014

Formula

Conjecturally, a(n) ~ (prime(n))^2, as n goes to infinity (cf. A246748, A246819). - Vladimir Shevelev, Sep 02 2014
a(n) = prime(n)^2 + 1 for and only for numbers n>=2 which are in A137291. - Vladimir Shevelev, Sep 04 2014

A210481 Given n-th prime p, a(n) = number of primes of the form p * q - 2 where q is any prime < p.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 1, 1, 4, 2, 2, 4, 3, 2, 4, 3, 4, 3, 4, 4, 6, 3, 4, 5, 3, 5, 5, 4, 3, 6, 4, 7, 5, 4, 6, 5, 7, 9, 7, 5, 6, 5, 6, 6, 8, 5, 7, 9, 5, 6, 7, 5, 7, 7, 9, 10, 3, 11, 8, 11, 6, 9, 8, 12, 8, 9, 7, 10, 9, 7, 8, 8, 6, 14, 8, 10, 11, 11, 12, 11, 7, 7
Offset: 1

Views

Author

Jayanta Basu, Apr 18 2013

Keywords

Comments

Very similar to A103960. - T. D. Noe, Apr 18 2013
a(A137291(n)) = A103960(A137291(n)) - 1. - Reinhard Zumkeller, Jul 30 2015

Crossrefs

Programs

  • Haskell
    a210481 n = sum [a010051' $ p * q - 2 |
                     let p = a000040 n, q <- takeWhile (< p) a000040_list]
    -- Reinhard Zumkeller, Jul 30 2015
  • Mathematica
    Table[p = Prime[n]; c = 0; Do[If[PrimeQ[p*Prime[i] - 2], c = c + 1], {i, n - 1}]; c, {n, 82}]
    Table[With[{pr=Prime[Range[n]]},Count[Most[pr]Last[pr]-2,?PrimeQ]],{n,90}] (* _Harvey P. Dale, Jul 19 2020 *)

A103960 Number of primes p such that prime(n)*p - 2 is prime and p <= prime(n).

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 1, 2, 4, 3, 2, 5, 3, 3, 5, 3, 4, 4, 4, 5, 6, 3, 4, 6, 3, 5, 6, 5, 3, 6, 5, 8, 5, 5, 6, 5, 7, 9, 7, 6, 6, 5, 7, 6, 8, 5, 8, 10, 5, 6, 8, 6, 7, 7, 10, 10, 3, 11, 8, 11, 6, 10, 8, 12, 9, 9, 7, 11, 9, 7, 8, 9, 6, 14, 8, 10, 11, 11, 12, 11, 7, 8
Offset: 1

Views

Author

Lei Zhou, Feb 22 2005

Keywords

Comments

Conjecture: All items of this sequence are greater than or equal to 1. Tested to prime(1000000).
a(A137291(n)) = A210481(A137291(n)) + 1. - Reinhard Zumkeller, Jul 30 2015

Examples

			Prime(1)*2-2 = 2, so a(1)=1;
Prime(3) = 5, 5*3-2 = 13, 5*5-2 = 23, so a(3)=2;
		

Crossrefs

Programs

  • Haskell
    a103960 n = sum [a010051' $ p * q - 2 |
                     let p = a000040 n, q <- takeWhile (<= p) a000040_list]
    -- Reinhard Zumkeller, Jul 30 2015
  • Mathematica
    Table[p=Prime[n]; ct=0; Do[pk=Prime[k]; If[PrimeQ[p*pk-2], ct=ct+1], {k, n}]; ct, {n, 100}]

A173472 Numbers k such that exactly one of prime(k)^2 - 2 and prime(k)^2 + 2 is prime.

Original entry on oeis.org

1, 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, 214
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 19 2010

Keywords

Comments

Essentially the same as A137291.

Examples

			a(1)=1 because prime(1)^2 - 2 = 2 is prime and prime(1)^2 + 2 = 6 is composite.
		

Crossrefs

Cf. A137291.

Programs

  • Maple
    isA173472 := proc(n) local p,pplus,pmin ; p := ithprime(n) ; pmin := isprime(p^2-2) ; pplus := isprime(p^2+2) ; if pmin <> pplus then return true; else return false; end if; end proc: for n from 1 to 300 do if isA173472(n) then printf("%d,",n) ; end if; end do ; # R. J. Mathar, Feb 21 2010

Extensions

More terms from R. J. Mathar, Feb 21 2010
Edited by Charles R Greathouse IV, Mar 24 2010
Showing 1-5 of 5 results.