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 42 results. Next

A028870 Numbers k such that k^2 - 2 is prime.

Original entry on oeis.org

2, 3, 5, 7, 9, 13, 15, 19, 21, 27, 29, 33, 35, 37, 43, 47, 49, 55, 61, 63, 69, 71, 75, 77, 89, 93, 103, 107, 117, 119, 121, 127, 131, 135, 139, 145, 155, 161, 169, 173, 177, 183, 191, 205, 211, 217, 223, 231, 233, 237, 239, 247, 253, 257, 259, 265, 267, 273, 279, 285
Offset: 1

Views

Author

Keywords

Comments

It is conjectured that this sequence is infinite.
Primes 2,3,5,7,13,... are in A062326. - Zak Seidov, Oct 05 2014

Examples

			5^2 - 2 = 23 is prime, so 5 is in the sequence.
		

References

  • D. Shanks, Solved and Unsolved Problems in Number Theory, 2nd. ed., Chelsea, 1978, p. 31.

Crossrefs

Cf. A028871.

Programs

Formula

a(n) = sqrt(2 + A028871(n)). - Zak Seidov, Oct 05 2014

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

A049002 Primes of form p^2 - 2, where p is prime.

Original entry on oeis.org

2, 7, 23, 47, 167, 359, 839, 1367, 1847, 2207, 3719, 5039, 7919, 10607, 11447, 16127, 17159, 19319, 29927, 36479, 44519, 49727, 54287, 57119, 66047, 85847, 97967, 113567, 128879, 177239, 196247, 201599, 218087, 241079, 273527, 292679, 323759
Offset: 1

Views

Author

Herman H. Rosenfeld (herm3(AT)pacbell.net)

Keywords

Examples

			127^2 - 2 = 16127.
		

Crossrefs

Primes in A049001.
Cf. A062326 (values of p).
Cf. A010051.

Programs

  • Haskell
    a049002 n = a049002_list !! (n-1)
    a049002_list = filter ((== 1) . a010051') a049001_list
    -- Reinhard Zumkeller, Jul 30 2015
  • Magma
    [a: p in PrimesUpTo(1000) | IsPrime(a) where a is p^2-2 ]; // Vincenzo Librandi, Apr 29 2015
    
  • Mathematica
    f[n_]:=n^2-2; lst={};Do[p=Prime[n];If[PrimeQ[f[p]],AppendTo[lst,f[p]]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 16 2009 *)
    Select[Prime[Range[150]]^2 - 2, PrimeQ] (* Vincenzo Librandi, Apr 29 2015 *)
  • PARI
    lista(nn) = forprime(p=1, nn, if (isprime(q=p^2-2), print1(q, ", "))); \\ Michel Marcus, Jan 08 2015
    
  • Sage
    a = lambda p: p^2-2
    [a(p) for p in primes(600) if is_prime(a(p))] # Bruno Berselli, Apr 29 2015
    

Formula

a(n) = A062326(n)^2-2. - Zak Seidov, Apr 29 2015

Extensions

More terms from James Sellers

A246748 Numbers n such that A242719(n) = (prime(n))^2+1 and A242720(n) - A242719(n) = 2*(prime(n)+1).

Original entry on oeis.org

3, 52, 104, 209, 343, 373, 398, 473, 628, 2633, 3273, 7538, 8060, 8813, 9025, 10847, 12493, 13768, 14196, 15486, 16865, 17486, 18362, 18613, 18842, 21175, 23522, 31825, 33537, 34507, 38740, 39603, 41802, 41947, 43314, 45479, 47550, 47668, 47787, 50321, 50682
Offset: 1

Views

Author

Vladimir Shevelev, Sep 02 2014

Keywords

Comments

If the sequence is infinite, then lim inf(A242719(k)/(prime(k))^2) = 1 and lim inf(A242720(k)/(prime(k))^2) = 1.
In connection with this, one can conjecture that A242719(k) ~ A242720(k) ~ (prime(k))^2, as k goes to infinity (cf. A246819, A246821).
n is in the sequence if and only if prime(n)>=5 and is in the intersection of A001359, A062326, A157468.
Proof. Firstly note that A242719(n) = prime(n)^2 + 1 if and only if prime(n)^2 - 2 is prime. Indeed, let prime(n)^2 + 1 be A242719(n). Then we have lpf(prime(n)^2 - 2) > lpf(prime(n)^2) = prime(n). It is possible only when prime(n)^2 - 2 is prime, i. e., prime(n) is in A062326. Add that prime(n)^2+1 is the smallest value of A242719(n).
Let A242720(n) = A242719(n) + 2*prime(n) + 2 = prime(n)^2 + 2*prime(n) + 3. Then, by the definition of A242720, we have lpf(prime(n)^2 + 2*prime(n) + 2) > lpf(prime(n)*(prime(n)+2)) >= prime(n). Thus prime(n) + 2 is prime, i.e., prime(n) is in A001359. Besides, lpf(prime(n)^2 + 2*prime(n) + 2) > prime(n), or lpf((prime(n)+1)^2 + 1) >= prime(n+1) = prime(n) + 2. So (prime(n)+1)^2+1 is prime, i.e., prime(n) is also in A157468.
Add that, for n>=3, N=prime(n)^2 + 2*prime(n) + 3 is the smallest possible value of A242720(n). Indeed, let prime(n)^2+1 <= N <= prime(n)^2 + 2*prime(n) + 2. Then prime(n)^2-2 <= N - 3 <= prime(n)^2 + 2*prime(n) - 1. Since it should be lpf(N-3) >= prime(n), then there are only two possibilities: N-3 = prime(n)^2 + prime(n) or N-3 = prime(n)^2. However, lpf(prime(n)^2 + prime(n)) = 2, while, although lpf(prime(n)^2) = prime(n), however, in this case, lpf(N-1) = lpf(prime(n)^2+2) = 3, n>=3, and, so the inequalities lpf(N-1) > lpf(N-3) >= prime(n) are impossible in the considered cases for n>=3. - Vladimir Shevelev, Sep 03 2014

Crossrefs

Extensions

More terms from Peter J. C. Moses, Sep 02 2014

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

Original entry on oeis.org

10, 26, 50, 254, 170, 392, 362, 944, 842, 1892, 1370, 2420, 1850, 2210, 3764, 6314, 3722, 4892, 5042, 7082, 8612, 9380, 7922, 12320, 11414, 10610, 11450, 13844, 18872, 16130, 17162, 20414, 19322, 26672, 24614, 25592, 29504, 37910, 29930, 44930, 36020, 36482
Offset: 2

Views

Author

Vladimir Shevelev, May 16 2014

Keywords

Comments

This sequence is connected with a sufficient condition for the infinitude of twin primes.
Almost all numbers of the form a(n)-3 are primes. For composite numbers of such a form, see A242716.
Primes p for which a(p) = p^2+1 form sequence A062326 for p >= 3. - Vladimir Shevelev, May 21 2014

Examples

			Let n=2, prime(2)=3. Then lpf(10-1)=3, but lpf(10-3)=7>3.
Since k=10 is the smallest such k, then a(2)=10.
		

Crossrefs

Programs

  • Mathematica
    lpf[n_]:=lpf[n]=First[Select[Divisors[n],PrimeQ[#]&]];
    Table[test=Prime[n];NestWhile[#+2&,test^2+1,!((lpf[#-1]==test)&&(lpf[#-3]>test))&],{n,2,60}] (* Peter J. C. Moses, May 21 2014 *)
  • PARI
    a(n) = {k = 6; p = prime(n); while ((factor(k-1)[1, 1] != p) || (factor(k-3)[1, 1] <= p), k+= 2); k;} \\ Michel Marcus, May 16 2014

Formula

a(n) >= prime(n)^2+1. - Vladimir Shevelev, May 21 2014

Extensions

More terms from Michel Marcus, May 16 2014

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

A230502 Number of ways to write n = (2-(n mod 2))*p + q + r with p <= q <= r such that p, q, r, p^2 - 2, q^2 - 2, r^2 - 2 are all prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Oct 21 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 6.
This is stronger than Goldbach's weak conjecture which was finally proved by H. Helfgott in 2013. It also implies that there are infinitely many primes p with p^2 - 2 also prime.
Conjecture verified for n up to 10^9. - Mauro Fiorentini, Sep 22 2023

Examples

			a(10) = 1 since 10 = 2*2 + 3 + 3 with 2, 3, 2^2 - 2 = 2, 3^2 - 2 = 7 all prime.
a(19) = 2 since 19 = 3 + 3 + 13 = 5 + 7 + 7 with 3, 13, 5, 7, 3^2 - 2 = 7, 13^2 - 2 = 167, 5^2 - 2 = 23, 7^2 - 2 = 47 all prime.
		

Crossrefs

Programs

  • Mathematica
    pp[n_]:=PrimeQ[n^2-2]
    pq[n_]:=PrimeQ[n]&&pp[n]
    a[n_]:=Sum[If[pp[Prime[i]]&&pp[Prime[j]]&&pq[n-(2-Mod[n,2])Prime[i]-Prime[j]],1,0],{i,1,PrimePi[n/(4-Mod[n,2])]},{j,i,PrimePi[(n-(2-Mod[n,2])Prime[i])/2]}]
    Table[a[n],{n,1,100}]

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

A118940 Primes p such that (p^2+7)/8 is prime.

Original entry on oeis.org

3, 7, 17, 23, 41, 47, 71, 89, 103, 113, 127, 137, 151, 191, 193, 199, 223, 263, 271, 281, 337, 359, 401, 439, 457, 503, 521, 569, 577, 599, 641, 719, 727, 751, 839, 857, 863, 881, 887, 929, 991, 1009, 1033, 1097, 1103, 1151, 1193, 1217, 1231, 1279, 1297, 1303
Offset: 1

Views

Author

T. D. Noe, May 06 2006

Keywords

Comments

For all primes q>2, we have q=4k+-1 for some k, which makes it easy to show that 8 divides q^2+7.

Crossrefs

Similar sequences, with p and (p^2+a)/b both prime, are A048161, A062324, A062326, A062718, A109953, A110589, A118915, A118918, A118939, A118941 and A118942.

Programs

  • Mathematica
    Select[Prime[Range[200]],PrimeQ[(#^2+7)/8]&]
  • PARI
    lista(nn) = {forprime(p=2, nn, iferr(if (isprime(q=(p^2+7)/8), print1(q, ", ")), E, ););} \\ Michel Marcus, Feb 18 2018
Showing 1-10 of 42 results. Next