login
Number of consecutive prime runs of 1 prime congruent to 1 mod 4 below 10^n.
4

%I #18 May 31 2019 20:10:44

%S 1,5,31,208,1555,12465,102704,869060,7540342,66571720,595513442

%N Number of consecutive prime runs of 1 prime congruent to 1 mod 4 below 10^n.

%F Generate the prime sequence with primes labeled 1 mod 4 or 3 mod 4. Add count of primes to sequence if just one prime occurs before interruption by a prime congruent to 3 mod 4.

%e a(3)=31 because 31 single primes occur below 10^3, each interrupted in the run by a prime congruent to 3 mod 4.

%t A002144 = Select[4 Range[0, 10^4] + 1, PrimeQ[#] &];

%t A002145 = Select[4 Range[0, 10^4] + 3, PrimeQ[#] &];

%t lst = {}; Do[If[Length[s = Select[A002144, Between[{A002145[[i]], A002145[[i + 1]]}]]] == 1, AppendTo[lst, Last[s]]], {i, Length[A002145] - 1}]; Table[Count[lst, x_ /; x < 10^n], {n, 4}] (* _Robert Price_, May 31 2019 *)

%o (PARI) a(n)=my(p=2,q=3,t);forprime(r=5,nextprime(10^n),if(q%4==1&&p%4==3&&r%4==3,t++);p=q;q=r);t \\ _Charles R Greathouse IV_, Sep 30 2011

%Y Cf. A091318, A092637-A092665.

%K more,nonn

%O 1,2

%A _Enoch Haga_, Mar 02 2004

%E a(9) from _Charles R Greathouse IV_, Sep 30 2011

%E a(10)-a(11) from _Chai Wah Wu_, Mar 18 2018