OFFSET
1,1
COMMENTS
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}.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
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
MATHEMATICA
Select[Union[Flatten[{(#^2 + # + 1 ), (#^2 + # - 1 ), (#^2 - # + 1 ), (#^2 - # - 1 )}] &[Prime[Range[100]]]], (PrimeQ[#]) &]
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Steiner, Aug 11 2017
STATUS
approved