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.

A302021 Numbers k such that k^2+1, (k+2)^2+1 and (k+6)^2+1 are prime.

This page as a plain text file.
%I A302021 #35 Apr 28 2025 11:53:44
%S A302021 4,14,124,204,464,1144,1314,1564,1964,2454,3134,4174,4364,5584,5874,
%T A302021 6234,7804,8174,8784,9874,9894,10424,12354,12484,12874,14034,14194,
%U A302021 15674,16224,18274,18994,21134,21344,22344,22624,23134,23784,23944,24974,25554,26504,26934,27064,27804,29364
%N A302021 Numbers k such that k^2+1, (k+2)^2+1 and (k+6)^2+1 are prime.
%H A302021 Chai Wah Wu, <a href="/A302021/b302021.txt">Table of n, a(n) for n = 1..10000</a> (n = 1..200 from Seiichi Manyama)
%p A302021 select(k->isprime(k^2+1) and isprime((k+2)^2+1) and isprime((k+6)^2+1),[$1..40000]); # _Muniru A Asiru_, Apr 02 2018
%t A302021 Select[Range[1, 30000], PrimeQ[#^2 + 1] && PrimeQ[(# + 2)^2 + 1] && PrimeQ[(# + 6)^2 + 1] &] (* _Vincenzo Librandi_, Apr 02 2018 *)
%o A302021 (Python)
%o A302021 from sympy import isprime
%o A302021 k, klist, A302021_list = 0, [isprime(i**2+1) for i in range(6)], []
%o A302021 while len(A302021_list) < 10000:
%o A302021     i = isprime((k+6)**2+1)
%o A302021     if klist[0] and klist[2] and i:
%o A302021         A302021_list.append(k)
%o A302021     k += 1
%o A302021     klist = klist[1:] + [i] # _Chai Wah Wu_, Apr 01 2018
%o A302021 (Magma) [n: n in [1..30000] | IsPrime(n^2+1) and IsPrime((n+2)^2+1) and IsPrime((n+6)^2+1)]; // _Vincenzo Librandi_, Apr 02 2018
%o A302021 (PARI) isok(k) = isprime(k^2+1) && isprime((k+2)^2+1) && isprime((k+6)^2+1); \\ _Altug Alkan_, Apr 02 2018
%Y A302021 Cf. A005574, A096012, A302087.
%K A302021 nonn
%O A302021 1,1
%A A302021 _Seiichi Manyama_, Mar 31 2018