login
Equal count of primes congruent to 1 mod 4 and 3 mod 4 associated with primes in A007351 (the zero beginning the sequence indicates the prime 2).
0

%I #11 Mar 28 2018 09:32:44

%S 0,1,3,6,44,1471,1472,1473,1474,1475,1476,25185,25187,25188,25189,

%T 25190,25196,25206,25211,25212,25213,25214,25215,25216,25217,25218,

%U 25219,25222,25224,25225,25251,25253,25257,25258,25410,25421,25426,25427

%N Equal count of primes congruent to 1 mod 4 and 3 mod 4 associated with primes in A007351 (the zero beginning the sequence indicates the prime 2).

%F Compute the running totals of primes congruent to 1 mod 4 and primes congruent to 3 mod 4. When these totals are equal, include in the sequence.

%e a(3)=3 because at this point there are 3 primes congruent to 1 mod 4: 5, 13, 17 and 3 primes congruent to 3 mod 4: 3, 7, 11.

%t Block[{a = 0, b = -1}, Reap[Do[If[Mod[p, 4] == 1, a++, b++]; If[a == b, Sow@ a, 0], {p, Prime@ Range[51000]}]][[-1, -1]]] (* _Michael De Vlieger_, Mar 26 2018 *)

%Y Cf. A007351.

%K easy,nonn

%O 1,3

%A _Enoch Haga_, Feb 24 2004

%E Typo in data corrected by _Sean Reeves_, Mar 24 2018