A270225 Lesser of twin primes where both primes are the sum of three squares.
3, 11, 17, 41, 59, 107, 137, 179, 227, 281, 347, 419, 521, 569, 617, 641, 659, 809, 827, 857, 881, 1019, 1049, 1091, 1289, 1427, 1451, 1481, 1619, 1667, 1697, 1721, 1787, 1931, 2027, 2081, 2129, 2267, 2339, 2657, 2729, 2801, 2969, 3251, 3257, 3299, 3329, 3371, 3467, 3539
Offset: 1
Keywords
Examples
3 is a term because 3 = 1^2 + 1^2 + 1^2 and 5 = 0^2 + 1^2 + 2^2. 17 is a term because 17 = 2^2 + 2^2 + 3^2 and 19 = 1^2 + 3^2 + 3^2. 41 is a term because 41 = 3^2 + 4^2 + 4^2 and 43 = 3^2 + 3^2 + 5^2. 59 is a term because 59 = 3^2 + 5^2 + 5^2 and 61 = 3^2 + 4^2 + 6^2.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..10000
Programs
-
Magma
[p: p in PrimesUpTo(4000) | IsPrime(p+2) and p mod 8 in [1,3]]; // Vincenzo Librandi, Jul 18 2016
-
Mathematica
Select[Prime[Range[500]], MemberQ[{1, 3}, Mod[#, 8]] && PrimeQ[# + 2] &] (* Vincenzo Librandi, Jul 18 2016 *)
-
PARI
isA004215(n) = my(fouri, j) ; fouri=1 ; while( n >=7*fouri, if( n % fouri ==0, j= n/fouri-7 ; if( j % 8==0, return(1) ) ; ); fouri *= 4 ; ) ; return(0); t(n, p=3) = { while( p+2 < (p=nextprime( p+1 )) || n-->0, ); p-2} for(n=1, 1e2, if(!isA004215(t(n)) && !isA004215(t(n)+2), print1(t(n), ", ")));
-
Python
from sympy import prime, isprime A270225_list = [p for p in (prime(i) for i in range(2,10**3)) if p % 8 not in {5,7} and isprime(p+2)] # Chai Wah Wu, Jul 18 2016
Formula
Primes p such that p == 1 or 3 mod 8 and p+2 is prime. - Chai Wah Wu, Jul 18 2016