%I #40 Feb 28 2026 12:27:31
%S 107,191,359,443,587,719,751,863,919,947,983,1091,1223,1283,1367,1439,
%T 1451,1619,1667,1699,1783,1871,1907,1951,2039,2207,2339,2447,2459,
%U 2687,2699,2711,2803,2879,3023,3271,3359,3371,3467,3491,3623,3719,3851,3863,3923
%N Primes p == 3 (mod 4) such that neither 2p-1 nor 2p+3 is a sum of two squares.
%C These primes are the exceptional primes p == 3 (mod 4) that do not admit a representation of the form p = u*(u+1) + v*(v+1) +-1.
%H Robert Israel, <a href="/A387306/b387306.txt">Table of n, a(n) for n = 1..10000</a>
%e For p = 47 == 3 (mod 4), we have 2p-1 = 93, which is not a sum of two squares. But 2p+3 = 97 = 9^2 + 4^2 is a sum of two squares, so 47 is not in this sequence.
%e For p = 107 == 3 (mod 4), we compute 2p-1 = 213 and 2p+3 = 217. Neither 213 nor 217 is a sum of two squares. Therefore 107 is in this sequence.
%p ns2:= proc(n)
%p ormap(t -> t[1] mod 4 = 3 and t[2]::odd, ifactors(n)[2])
%p end proc:
%p filter:= n -> isprime(n) and ns2(2*n-1) and ns2(2*n+3):
%p select(filter, [seq(i,i=3..4000, 4)]); # _Robert Israel_, Sep 04 2025
%Y Cf. A002145 (primes == 3 (mod 4)), A001481 (sum of two squares, zeros allowed), A022544 (not a sum of two squares, zeros allowed).
%K nonn
%O 1,1
%A _Charles Kusniec_, Aug 25 2025