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.

Previous Showing 21-30 of 42 results. Next

A237367 Number of ordered ways to write n = k + m with k > 0 and m > 0 such that 2*k - 1, prime(k)^2 - 2 and prime(m)^2 - 2 are all prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 07 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 2, and a(n) = 1 only for n = 3, 73, 81, 534.
(ii) Any integer n > 2 can be written as k + m with k > 0 and m > 0 such that 2*k - 1, prime(k) + k*(k-1) and prime(m) + m*(m-1) are all prime.
(iii) Every n = 9, 10, ... can be written as k + m with k > 0 and m > 0 such that 6*k - 1, prime(k) + 2*k and prime(m) + 2*m are all prime.
Clearly, part (i) of this conjecture implies that there are infinitely many primes p with p^2 - 2 also prime. Similar comments apply to parts (ii) and (iii).

Examples

			a(3) = 1 since 3 = 2 + 1 with 2*2 - 1 = 3, prime(2)^2 - 2 = 3^2 - 2 = 7 and prime(1)^2 - 2 = 2^2 - 2 = 2 all prime.
a(73) = 1 since 73 = 55 + 18 with 2*55 - 1 = 109, prime(55)^2 - 2 = 257^2 - 2 = 66047 and prime(18)^2 - 2 = 61^2 - 2 = 3719 all prime.
a(81) = 1 since 81 = 34 + 47 with 2*34 - 1 = 67, prime(34)^2 - 2 = 139^2 - 2 = 19319 and prime(47)^2 - 2 = 211^2 - 2 = 44519 all prime.
a(534) = 1 since 534 = 100 + 434 with 2*100 - 1 = 199, prime(100)^2 - 2 = 541^2 - 2 = 292679 and prime(434)^2 - 2 = 3023^2 - 2 = 9138527 all prime.
		

Crossrefs

Programs

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

A237414 Primes p with p^2 - 2 and prime(p)^2 - 2 both prime.

Original entry on oeis.org

2, 3, 43, 47, 107, 139, 191, 211, 223, 239, 293, 313, 337, 541, 743, 757, 863, 1013, 1153, 1231, 1619, 2113, 2137, 2287, 2297, 2423, 2543, 2729, 2749, 2897, 3079, 3089, 3313, 3863, 3947, 4241, 4271, 4583, 4649, 4993, 5581, 6571, 6637, 6911, 7547, 8629, 8849, 8867, 9049, 9661
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 07 2014

Keywords

Comments

According to the conjecture in A237413, this sequence should have infinitely many terms.

Examples

			a(1) = 2 since 2^2 - 2 = 2 and prime(2)^2 - 2 = 3^2 - 2 = 7 are both prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[n^2-2]
    n=0;Do[If[p[Prime[k]]&&p[Prime[Prime[k]]],n=n+1;Print[n," ",Prime[k]]],{k,1,1000}]
    Select[Prime[Range[1200]],AllTrue[{#^2-2,Prime[#]^2-2},PrimeQ]&] (* Harvey P. Dale, Apr 06 2022 *)

A253257 Least positive integer k such that prime(k*n) has the form p^2 - 2 with p prime, or 0 if no such k exists.

Original entry on oeis.org

1, 2, 3, 1, 3, 12, 47, 9, 1, 100, 502, 6, 3, 1817, 1, 362, 3141, 4, 104, 50, 14157, 251, 222, 3, 27, 76, 25, 5423, 416, 73, 28764, 181, 488, 3860, 1249, 2, 138, 52, 1, 25, 8734, 65719, 7089, 214, 15, 111, 7, 990, 6254, 20, 1047, 38, 367, 880, 435, 3712, 3287, 208, 5194, 598
Offset: 1

Views

Author

Zhi-Wei Sun, Jul 05 2015

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0.
This is stronger than the conjecture that there are infinitely many primes of the form p^2-2 with p prime.
I also conjecture that for any positive integer n there is a positive integer k such that prime(k*n) has the form 2*p^2-1 (or 4*p^2+1, or p^2+p+1) with p prime.

Examples

			a(1) = 1 since prime(1*1) = 2 = 2^2-2 with 2 prime.
a(6) = 12 since prime(12*6) = 359 = 19^2-2 with 19 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
    SQ[n_]:=IntegerQ[Sqrt[n]]&&PrimeQ[Sqrt[n]]
    Do[k=0;Label[bb];k=k+1;If[SQ[Prime[k*n]+2],Goto[aa],Goto[bb]];Label[aa];Print[n, " ", k];Continue,{n,1,60}]
  • Perl
    use ntheory ":all"; use Math::Prime::Util::PrimeArray qw/$probj/; my %v; forprimes { undef $v{$*$-2} } 4e7; for my $n (1..800) { my $k=1; $k++ until exists $v{$probj->FETCH($k*$n-1)}; say "$n $k"; } # Dana Jacobsen, Dec 15 2015

A257551 Primes p such that q=p^2-2 and r=q^2-2 are also prime.

Original entry on oeis.org

2, 3, 7, 19, 37, 89, 211, 223, 257, 797, 1021, 1051, 1153, 1619, 2087, 2297, 3299, 3359, 3709, 3943, 4093, 4229, 4349, 4451, 4621, 5119, 5209, 5923, 6323, 6361, 7229, 7589, 8731, 8867, 9127, 9697, 9721, 9907, 10009, 10289, 10729, 11149, 11437, 11699, 11933
Offset: 1

Views

Author

Zak Seidov, Apr 29 2015

Keywords

Comments

Primes p that remain prime under two iterations of the map p => p^2-2. Note that p=2 is a fixed point of this map.
First primes >2 that remain prime under three iterations of the map p => p^2-2, are 3, 3299, 6323, 9127, 9697, 26357 (A257552).

Examples

			p=3, q=7, r=47 all prime,
p=7, q=47, r=2207 all prime,
p=19, q=359, r=128879 all prime.
		

Crossrefs

Subsequence of A062326. A257552 is a subsequence.

Programs

  • Magma
    [p: p in PrimesUpTo(15000)| IsPrime(p^4-4*p^2+2)and IsPrime(p^2-2)]; // Vincenzo Librandi, Apr 30 2015
    
  • Maple
    filter:= proc(p) local q;
      if not isprime(p) then return false fi;
      q:= p^2-2;
      isprime(q) and isprime(q^2-2)
    end proc:
    select(filter, [2,seq(i,i=3..20000,2)]); # Robert Israel, Oct 31 2019
  • Mathematica
    Select[Prime@ Range@ 2000, PrimeQ[#^2 - 2] && PrimeQ[Nest[#^2 - 2 &, #, 2]] &] (* Michael De Vlieger, Apr 29 2015 *)
    Select[Prime@Range@2000, PrimeQ[#^2 - 2] && PrimeQ[#^4 -4 #^2 + 2] &] (* Vincenzo Librandi, Apr 30 2015 *)
  • PARI
    forprime(p=1,10^4,if(isprime(q=p^2-2)&&isprime(q^2-2),print1(p,", "))) \\ Derek Orr, Apr 30 2015

Extensions

More terms from Vincenzo Librandi, Apr 30 2015

A257552 Primes p such that q = p^2 - 2, r = q^2 - 2 and s = r^2 - 2 are also prime.

Original entry on oeis.org

2, 3, 3299, 6323, 9127, 9697, 26357, 27061, 27809, 77513, 83299, 83641, 87701, 99721, 117307, 152123, 197969, 202987, 243461, 248179, 249397, 262121, 285721, 285823, 351217, 379273, 388009, 397763, 436477, 502063, 523777, 531263, 541661, 583501, 651881
Offset: 1

Views

Author

Zak Seidov, Apr 29 2015

Keywords

Comments

Are there primes p > 2 such that t = s^2 - 2 is also prime?
t = s^2 - 2 is prime for p = 1644103, 3892831, 5178193, 5497949, 5657699, ... - Chai Wah Wu, Apr 30 2015

Examples

			3 is in the sequence because 3^2 - 2 = 7, 7^2 - 2 = 47 and 47^2 - 2 = 2207 are all primes.
5 is not in the sequence, because, although 5^2 - 2 = 23 is prime, 23^2 - 2 = 527 = 17 * 31.
		

Crossrefs

Subsequence of A257551 and A062326.
Cf. A253264.

Programs

  • Magma
    [p: p in PrimesUpTo(1500000)| IsPrime(p^4-4*p^2+2)and IsPrime(p^2-2)and IsPrime(p^8-8*p^6+20*p^4-16*p^2+2)]; // Vincenzo Librandi, Apr 30 2015
    
  • Mathematica
    Select[Prime@ Range@ 100000, PrimeQ[#^2 - 2] && PrimeQ[Nest[#^2 - 2 &, #, 2]] && PrimeQ[Nest[#^2 - 2 &, #, 3]] &] (* Michael De Vlieger, Apr 29 2015 *)
    Select[Prime@Range@60000, PrimeQ[#^2 - 2] && PrimeQ[#^4 - 4 #^2 + 2] && PrimeQ[#^8 - 8 #^6 + 20 #^4 - 16 #^2 + 2] &] (* Vincenzo Librandi, Apr 30 2015 *)
    Select[Prime[Range[10^4]], Union[PrimeQ[{#^2 - 2, #^4 - 4#^2 + 2, #^8 - 8#^6 + 20#^4 - 16#^2 + 2}]] == {True} &] (* Alonso del Arte, May 01 2015 *)
  • Perl
    use Math::GMP ":constant"; use ntheory ":all"; my($q,$r,$s); forprimes { say if is_prime($q=$**2-2) && is_prime($r=$q**2-2) && is_prime($s=$r**2-2); } 1e9;  # _Dana Jacobsen, May 02 2015
  • Python
    from gmpy2 import is_prime, next_prime
    A257552_list, p = [], 2
    for _ in range(10**9):
        q = p**2 - 2
        if is_prime(q):
            r = q**2 -2
            if is_prime(r):
                s = r**2-2
                if is_prime(s):
                    A257552_list.append(p)
        p = next_prime(p) # Chai Wah Wu, Apr 30 2015
    

Extensions

More terms from Vincenzo Librandi, Apr 30 2015

A347194 Numbers such that the two adjacent integers are a prime and the square of another prime.

Original entry on oeis.org

8, 10, 24, 48, 168, 360, 840, 1368, 1848, 2208, 3720, 5040, 7920, 10608, 11448, 16128, 17160, 19320, 29928, 36480, 44520, 49728, 54288, 57120, 66048, 85848, 97968, 113568, 128880, 177240, 196248, 201600, 218088, 241080, 273528, 292680, 323760, 344568, 368448, 426408, 458328, 516960, 528528, 537288, 552048, 564000, 573048, 579120
Offset: 1

Views

Author

Bernard Schott, Sep 23 2021

Keywords

Comments

-> Equivalently, numbers k such that tau(k^2-1) = A347191(k) = 6 (see example; used for Maple code).
Proof: tau(k^2-1) = 6 <==> k^2-1 = p^5 or k^2-1 = p*q^2 with p <> q primes; but k^2-p^5 = 1 is impossible, as a consequence of the Catalan-Mihăilescu theorem; now, (k-1)*(k+1) = p*q^2 ==> (k-1 = p and k+1 = q^2) or (k-1 = q^2 and k+1 = p), because k-1 = q and k+1 = p*q is not possible, otherwise 2 = q*(p-1), which would contradict p <> q.
-> There are two possible configurations with p, q primes: (q^2 < a(n) < p) or (p < a(n) < q^2).
The unique configuration q^2 < a(n) < p is for q = 3, a(2) = 10 and p = 11.
All the other configurations, for n = 1 or n >= 3, are of the form p < a(n) < q^2 with p = A049002(n) and q = A062326(n).
-> Note that there is only one integer such that the two adjacent integers are a prime and the square of that prime: it is 3, which lies between 2 and 2^2; in this case, tau(3^2-1) = 4.

Examples

			8 is a term since 8 lies between 7 (prime) and 9 = 3^2 (square of prime); also tau(8^2-1) = tau(63) = 6.
10 is a term since 10 lies between 9 = 3^2 (square of prime) and 11 (prime); also tau(10^2-1) = tau(99) = 6.
24 is a term since 24 lies between 23 (prime) and 25 = 5^2 (square of prime); also tau(24^2-1) = tau(575) = 6.
		

Crossrefs

Subsequence of A163492 (between prime and a perfect square).

Programs

  • Maple
    with(numtheory):
    filter := q-> tau(q^2-1) = 6 : select(filter, [$2..580000]);
  • Mathematica
    q[n_] := Module[{e1 = FactorInteger[n - 1][[;; , 2]], e2 = FactorInteger[n + 1][[;; , 2]]}, (e1 == {1} && e2 == {2}) || (e1 == {2} && e2 == {1})]; Select[Range[4, 600000], q] (* Amiram Eldar, Sep 23 2021 *)
  • PARI
    isok(m) = my(pa, pb); (isprimepower(m-1, &pa)*isprimepower(m+1, &pb) == 2) && (pa != pb); \\ Michel Marcus, Sep 23 2021
    
  • PARI
    upto(n) = { my(res = List()); forprime(i = 3, sqrtint(n-1), if(isprime(i^2 - 2), listput(res, i^2-1); ); if(isprime(i^2 + 2), listput(res, i^2 + 1); ) ); res } \\ David A. Corneth, Sep 23 2021

Formula

For n >= 3: a(n) = A049002(n) + 1 = a(n) = A146981(n) - 1 = (A049002(n) + A146981(n))/2 = A062326(n)^2 - 1.

A146981 Numbers k of the form q^2, q = prime, such that k-2 is a prime.

Original entry on oeis.org

4, 9, 25, 49, 169, 361, 841, 1369, 1849, 2209, 3721, 5041, 7921, 10609, 11449, 16129, 17161, 19321, 29929, 36481, 44521, 49729, 54289, 57121, 66049, 85849, 97969, 113569, 128881, 177241, 196249, 201601, 218089, 241081, 273529, 292681, 323761
Offset: 1

Views

Author

Giovanni Teofilatto, Nov 04 2008

Keywords

Comments

Except for initial term, a(n) - 1 is not a squarefree number.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[150]]^2,PrimeQ[#-2]&] (* Harvey P. Dale, Jan 15 2020 *)

Formula

a(n) = A049002(n) + 2.
a(n) = A062326(n)^2. - Amiram Eldar, Oct 21 2019

Extensions

Corrected (3721 inserted, 10321 replaced by 19321, 49729 and 218089 inserted) by R. J. Mathar, Apr 22 2010

A160687 Primes p such that p^2-2, p^4-2, p^6-2, p^8-2 and p^10-2 are all prime.

Original entry on oeis.org

1068367, 72605597, 167800459, 342300461, 945454063, 1271025127, 1311243709, 1723430689, 1742554057, 2088627479, 2773023247, 3280315037, 3854112263, 4146729383, 4663996819, 5351452567, 6129009319, 6262797449, 6418720631, 7409777803, 7993593973, 8834281793
Offset: 1

Views

Author

Dmitry Kamenetsky, May 24 2009

Keywords

Comments

p=15912460901 is in this sequence and p^12-2 is also prime. [From Dmitry Kamenetsky, May 26 2009]

Crossrefs

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

Original entry on oeis.org

152558869, 480575479, 550688041, 863687971, 1388856589, 1518546259, 1628566519, 2205080989, 2284848061, 2441941039, 3086181811, 3222124669, 3325371979, 3705499309, 3782535301, 5331767491, 5671038871, 5842510939
Offset: 1

Views

Author

Dmitry Kamenetsky, May 24 2009

Keywords

Comments

p=9069690841 is in this sequence and p^7-2 is also prime. [From Dmitry Kamenetsky, May 26 2009]

Crossrefs

Extensions

More terms copied from author's b-file by Hagen von Eitzen, Jul 20 2009

A240436 Semiprimes of the form n^3 - 2*n.

Original entry on oeis.org

4, 21, 115, 329, 2171, 6821, 24331, 50579, 79421, 103729, 226859, 357769, 704791, 1092521, 1224829, 2048129, 2247829, 2685341, 5177371, 6967489, 9393509, 11089121, 12648871, 13651441, 16974079, 25153171, 30663671, 38272079, 46267561, 74617619, 86937421, 90517951
Offset: 1

Views

Author

K. D. Bajpai, Aug 17 2014

Keywords

Comments

Intersection of A001358 and A242135.
Since n^3 - 2*n = n * (n^2 - 2), it follows that n and (n^2 - 2) both should be prime.

Examples

			a(2) = 21: 3^3 - 2*3 = 27 - 6 = 21 = 3 * 7, which is semiprime.
a(3) = 115: 5^3 - 2*5 = 125 - 10 = 115 = 5 * 23, which is semiprime.
		

Crossrefs

Programs

  • Maple
    select(k -> numtheory:-bigomega(k)=2, [seq((n^3-2*n), n=1..500)]);
  • Mathematica
    Select[Table[n^3 - 2*n, {n, 1000}], PrimeOmega[#] == 2 &]
  • PARI
    forprime(p=1,10^3,q=p^2-2;if(isprime(q),print1(p*q,", "))) \\ Derek Orr, Aug 17 2014

Formula

a(n) = A062326(n) * (A062326(n)^2 - 2). - Michel Marcus, Aug 26 2014
Previous Showing 21-30 of 42 results. Next