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!)
A127079 Number of ways to represent prime(n) as a+b with a >= b > 0 and a^2+b^2 prime. 1

%I #11 Aug 19 2020 09:26:55

%S 1,1,2,2,3,3,4,4,4,6,5,8,9,7,7,9,9,11,11,9,11,13,15,14,14,18,16,17,16,

%T 20,18,22,18,21,23,21,24,24,22,24,22,28,30,23,27,24,29,30,30,28,29,24,

%U 28,30,34,33,36,35,31,37,32,36,37,41,42,42,42,43,42,38,34,43,38,45,44

%N Number of ways to represent prime(n) as a+b with a >= b > 0 and a^2+b^2 prime.

%C Essentially A036468 restricted to the primes.

%C a(n) <= floor(prime(n)/2).

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

%e prime(5) = 11 can be represented as 10+1, 9+2, 8+3, 7+4 and 6+5. Among 10^2+1^2 = 101, 9^2+2^2 = 85, 8^2+3^2 = 73, 7^2+4^2 = 65 and 6^2+5^2 = 61 are three primes, hence a(5) = 3.

%p f:= proc(n) local a;

%p add(charfcn[{true}](isprime(a^2 + (n-a)^2)), a=1..n/2)

%p end proc:

%p map(f, [seq(ithprime(i),i=1..100)]); # _Robert Israel_, Jun 03 2019

%t Reap[Do[p = Prime[n]; c = 0; Do[b = p - a; If[PrimeQ[a^2 + b^2], c++], {a, 1, p/2}]; Sow[c], {n, 1, 75}]][[2, 1]] (* _Jean-François Alcover_, Aug 19 2020 *)

%o (PARI) {for(n=1, 75, p=prime(n); c=0; for(a=1, p\2, b=p-a; if(isprime(a^2+b^2), c++)); print1(c, ","))} /* _Klaus Brockhaus_, Mar 26 2007 */

%Y Cf. A036468.

%K nonn

%O 1,3

%A _J. M. Bergot_, Mar 24 2007

%E Edited and extended by _Klaus Brockhaus_, Mar 26 2007

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 29 10:22 EDT 2024. Contains 371268 sequences. (Running on oeis4.)