login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A270225 Lesser of twin primes where both primes are the sum of three squares. 2

%I #21 Sep 08 2022 08:46:16

%S 3,11,17,41,59,107,137,179,227,281,347,419,521,569,617,641,659,809,

%T 827,857,881,1019,1049,1091,1289,1427,1451,1481,1619,1667,1697,1721,

%U 1787,1931,2027,2081,2129,2267,2339,2657,2729,2801,2969,3251,3257,3299,3329,3371,3467,3539

%N Lesser of twin primes where both primes are the sum of three squares.

%H Chai Wah Wu, <a href="/A270225/b270225.txt">Table of n, a(n) for n = 1..10000</a>

%F Primes p such that p == 1 or 3 mod 8 and p+2 is prime. - _Chai Wah Wu_, Jul 18 2016

%e 3 is a term because 3 = 1^2 + 1^2 + 1^2 and 5 = 0^2 + 1^2 + 2^2.

%e 17 is a term because 17 = 2^2 + 2^2 + 3^2 and 19 = 1^2 + 3^2 + 3^2.

%e 41 is a term because 41 = 3^2 + 4^2 + 4^2 and 43 = 3^2 + 3^2 + 5^2.

%e 59 is a term because 59 = 3^2 + 5^2 + 5^2 and 61 = 3^2 + 4^2 + 6^2.

%t Select[Prime[Range[500]], MemberQ[{1, 3}, Mod[#, 8]] && PrimeQ[# + 2] &] (* _Vincenzo Librandi_, Jul 18 2016 *)

%o (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);

%o t(n, p=3) = { while( p+2 < (p=nextprime( p+1 )) || n-->0, ); p-2}

%o for(n=1, 1e2, if(!isA004215(t(n)) && !isA004215(t(n)+2), print1(t(n), ", ")));

%o (Python)

%o from sympy import prime, isprime

%o 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

%o (Magma) [p: p in PrimesUpTo(4000) | IsPrime(p+2) and p mod 8 in [1,3]]; // _Vincenzo Librandi_, Jul 18 2016

%Y Cf. A001359, A004215, A269840.

%K nonn

%O 1,1

%A _Altug Alkan_, Mar 13 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 05:39 EDT 2024. Contains 371235 sequences. (Running on oeis4.)