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

A274525 Prime numbers p such that p - 2, p^2 - p - 1, p^2 - p + 1 are prime numbers.

Original entry on oeis.org

7, 139, 1789, 2731, 4159, 5641, 13339, 13399, 19429, 21739, 22369, 32059, 32911, 33601, 42571, 45319, 54541, 55339, 65449, 68821, 106189, 108499, 111871, 132859, 136399, 138079, 141511, 142981, 148201, 149629, 152041, 152839, 173431, 174049, 178249
Offset: 1

Views

Author

Pierre CAMI, Jun 27 2016

Keywords

Examples

			5 - 2 = 3 prime, 5 prime, 5*(5-1) - 1 = 19 prime, 5*(5-1) + 1 = 21 composite, so 5 is not in the sequence.
7 - 2 = 5 prime, 7 prime, 7*(7-1) - 1 = 41 prime, 7*(7-1) + 1 = 43 prime so 7 is in the sequence.
		

Crossrefs

Cf. A228968.

Programs

  • Mathematica
    Select[Prime[Range[100]], Union[PrimeQ[{# - 2, #^2 - # - 1, #^2 - # + 1}]] == {True} &] (* Alonso del Arte, Jun 27 2016 *)
    Select[Prime[Range[17000]],AllTrue[{#-2,#^2-#-1,#^2-#+1},PrimeQ]&] (* Harvey P. Dale, Jun 20 2024 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if (isprime(p-2) && isprime(p^2-p-1) && isprime(p^2-p+1), print1(p, ", "))); \\ Michel Marcus, Jul 07 2016
    
  • Python
    from sympy import isprime, primerange
    def aupto(n):
        t = []
        for p in primerange(2, n+1):
            if isprime(p-2) and isprime(p**2 - p - 1) and isprime(p**2 - p + 1):
                t.append(p)
        return t # Paul Muljadi, Jun 21 2024

A274527 Prime numbers p such that p+2, p^2+p-1, p^2+p+1, p^2+3*p+1, p^2+3*p+3 are all prime numbers.

Original entry on oeis.org

5, 2729, 26449079, 27188279, 44521679, 46090379, 52736249, 62320439, 70777979, 92520539, 109505969, 192153149, 274448789, 288269519, 343801919, 359240069, 515694899, 521594639, 527159429, 660223409, 809600819, 857353139, 921868289, 945420629, 1000777049
Offset: 1

Views

Author

Pierre CAMI, Jun 27 2016

Keywords

Examples

			2 first prime, 2+2=4 composite.
3 prime, 3+2=5 prime, 3^2+3-1=11 prime, 3^2+3+1=13 prime, 3^2+3*3+1=19 prime, 3^2+3*3+3=21 composite.
5 prime, 5+2=7 prime, 5^2+5-1=29 prime, 5^2+5+1=31 prime, 5^2+3*5+1=41 prime, 5^2+3*5+3=43 prime so a(1)=5
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[50890000]],AllTrue[{#+2,#^2+#-1,#^2+#+1,#^2+3#+1,#^2+3#+3},PrimeQ]&] (* Harvey P. Dale, Aug 13 2021 *)

A228978 Primes p such that p and p+2, p^2+p-1 and p^2+p+1, and (p^2+p-1)^2+p^2+p-2 and (p^2+p-1)^2+p^2+p are three pairs of twin primes.

Original entry on oeis.org

11767181, 35057849, 84428051, 91460249, 105929711, 115401719, 162790781, 197352401, 217761851, 235863209, 266250839, 284597741, 370000511, 386278019, 554761451, 576412271, 581549669, 592975109, 611599661, 625806761, 626450411, 655727771, 670280591, 680468669, 744737111, 883687349, 1085880641, 1119813311, 1139369111
Offset: 1

Views

Author

Pierre CAMI, Sep 10 2013

Keywords

Comments

Subsequence of A228968.

Crossrefs

Programs

  • Mathematica
    tptpQ[n_]:=Module[{p2=n^2+n},AllTrue[{p2-1,p2+1,(p2-1)^2+p2-2,(p2-1)^2+ p2},PrimeQ]]; Select[Transpose[Select[Partition[ Prime[ Range[ 58*10^6]],2,1], #[[2]]-#[[1]]==2&]][[1]],tptpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 10 2014 *)

Extensions

Corrected by Harvey P. Dale, Nov 10 2014
Showing 1-3 of 3 results.