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.

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

This page as a plain text file.
%I A274525 #35 Jul 07 2024 21:14:48
%S A274525 7,139,1789,2731,4159,5641,13339,13399,19429,21739,22369,32059,32911,
%T A274525 33601,42571,45319,54541,55339,65449,68821,106189,108499,111871,
%U A274525 132859,136399,138079,141511,142981,148201,149629,152041,152839,173431,174049,178249
%N A274525 Prime numbers p such that p - 2, p^2 - p - 1, p^2 - p + 1 are prime numbers.
%H A274525 Pierre CAMI, <a href="/A274525/b274525.txt">Table of n, a(n) for n = 1..30000</a>
%e A274525 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.
%e A274525 7 - 2 = 5 prime, 7 prime, 7*(7-1) - 1 = 41 prime, 7*(7-1) + 1 = 43 prime so 7 is in the sequence.
%t A274525 Select[Prime[Range[100]], Union[PrimeQ[{# - 2, #^2 - # - 1, #^2 - # + 1}]] == {True} &] (* _Alonso del Arte_, Jun 27 2016 *)
%t A274525 Select[Prime[Range[17000]],AllTrue[{#-2,#^2-#-1,#^2-#+1},PrimeQ]&] (* _Harvey P. Dale_, Jun 20 2024 *)
%o A274525 (PFGW & SCRIPT) twin.txt file with the smallest of twin pairs.
%o A274525 SCRIPT
%o A274525 DIM n
%o A274525 OPENFILEIN maf,twin.txt
%o A274525 OPENFILEOUT myf,a.txt
%o A274525 LABEL loop
%o A274525 GETNEXT n,maf
%o A274525 SET n,n+2
%o A274525 SET m,n*(n-1)-1
%o A274525 PRP m
%o A274525 IF ISPRP THEN GOTO a
%o A274525 GOTO loop
%o A274525 LABEL a
%o A274525 PRP m+2
%o A274525 IF ISPRP THEN WRITE myf,n
%o A274525 GOTO loop
%o A274525 (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
%o A274525 (Python)
%o A274525 from sympy import isprime, primerange
%o A274525 def aupto(n):
%o A274525     t = []
%o A274525     for p in primerange(2, n+1):
%o A274525         if isprime(p-2) and isprime(p**2 - p - 1) and isprime(p**2 - p + 1):
%o A274525             t.append(p)
%o A274525     return t # _Paul Muljadi_, Jun 21 2024
%Y A274525 Cf. A228968.
%K A274525 nonn
%O A274525 1,1
%A A274525 _Pierre CAMI_, Jun 27 2016