%I #17 May 24 2016 16:16:30
%S 337,409,449,577,1009,1129,1489,1801,2377,2521,2609,2689,2833,3041,
%T 3169,3329,3361,3433,3529,3889,4049,4513,4657,5209,5569,5689,5857,
%U 5881,5953,6529,6553,6569,7177,7297,8009,8089,8209,8329,8641,8737,8761,9433,9697,9769,10169,10321
%N Primes p of the form x^2 + y^2 such that p+1 is the sum of the two nonzero squares in exactly 2 ways.
%C Number of prime divisors (counted with multiplicity) of p+1 is 3, 3, 5, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 5, 3, 5, 3, 3, 3, 3, 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 3, 3, 3, 3, 5, 3, 7, 3, 3, 5, 3, 3, 3, 5, 5, 3, 3, 3, 3, 3, ...
%C In this sequence, 20249 is the first p such that p+1 has even number of prime divisors (counted with multiplicity).
%H Charles R Greathouse IV, <a href="/A273529/b273529.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) mod 8 = 1.
%e The prime 409 is a term because 409 = 3^2 + 20^2 and 410 = 7^2 + 19^2 = 11^2 + 17^2.
%o (PARI) is(n, k)=nb = 0; lim = sqrtint(n); for (x=1, lim, if ((n-x^2 >= x^2) && issquare(n-x^2), nb++); ); nb == k;
%o isok(n) = isprime(n) && is(n, 1) && is(n+1, 2);
%o (PARI) is(n)=if(n%8!=1 || !isprime(n), return(0)); my(f=factor((n+1)/2), t=1); for(i=1, #f~, if(f[i, 1]%4==1, t*=f[i, 2]+1, if(f[i, 2]%2, return(0)))); t==3 || t==4 \\ _Charles R Greathouse IV_, May 24 2016
%Y Cf. A002313, A025285.
%K nonn
%O 1,1
%A _Altug Alkan_, May 24 2016
|