login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Primes of at least one of the forms p^2 +- p +- 1, where p is prime.
1

%I #44 Sep 08 2022 08:46:19

%S 3,5,7,11,13,19,29,31,41,43,109,131,157,181,271,307,379,811,929,991,

%T 1721,1723,2161,2861,3539,3541,3659,4421,4423,4969,5113,6163,6971,

%U 8009,8011,9311,10099,10301,10303,10711,16001,17029,17291,17293,19181,19183,22051,22349,22651

%N Primes of at least one of the forms p^2 +- p +- 1, where p is prime.

%C This sequence contains prime chains and prime trees using an appropriate mapping form p^2 +- p +- 1 in each step, such as the chain: 3 -> 5 -> 19 -> 379 -> 143263 -> 20524143907 and the tree: 41 -> {1721, 1723}.

%H Robert Israel, <a href="/A290817/b290817.txt">Table of n, a(n) for n = 1..10000</a>

%p select(isprime, [3,seq(op([p^2-p-1,p^2-p+1,p^2+p-1,p^2+p+1]),p=select(isprime,[seq(i,i=3..1000,2)]))]); # _Robert Israel_, Nov 27 2019

%t Select[Union[Flatten[{(#^2 + # + 1 ), (#^2 + # - 1 ), (#^2 - # + 1 ), (#^2 - # - 1 )}] &[Prime[Range[100]]]], (PrimeQ[#]) &]

%o (Magma) {p^2+(-1)^k*p+(-1)^s:p in PrimesUpTo(150), s,k in [1..2]|IsPrime(p^2+(-1)^k*p+(-1)^s)}; // _Marius A. Burtea_, Nov 28 2019

%Y Cf. A000040.

%Y Union of A053183, A053185, A074268, A091568.

%K nonn

%O 1,1

%A _Ralf Steiner_, Aug 11 2017