cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A127977 The minimum excess in the prime race of odious primes versus evil primes in the interval (2^(n-1),2^n).

This page as a plain text file.
%I A127977 #24 Apr 18 2018 04:55:02
%S A127977 0,1,4,7,13,19,39,53,104,138,251,334,590,715,1353,1855,3659,5221,
%T A127977 10484,14933,27491,35474,68816,97342,186405,265255
%N A127977 The minimum excess in the prime race of odious primes versus evil primes in the interval (2^(n-1),2^n).
%C A127977 Shevelev conjectures (p.2) that for all natural numbers n other than 5 and 6, the number of evil primes not exceeding n <= the number of odious primes not exceeding n. Odious primes are A027697. Evil primes are A027699.
%H A127977 Vladimir Shevelev, <a href="https://arxiv.org/abs/0706.0786">A Conjecture on Primes and a Step towards Justification</a>, arXiv:0706.0786 [math.NT], 2007. See table 1, p. 2.
%H A127977 Vladimir Shevelev, <a href="http://arxiv.org/abs/0707.1761">On excess of the odious primes</a>, arXiv:0707.1761 [math.NT], 2007.
%e A127977 OdiPrimePi(x) for x >= 32 is 6, 6, 6, 6, 6, 7, 7, 7, 7, 8,.. and EviPrimePi(x) for x>=32 is 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6,...
%e A127977 The difference OdiPrimePi(x)-EviPrimePi(x) is 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 3,.. so the minimum of the difference in the interval 2^(6-1)..2^6 is 1, yielding a(6)=1.
%p A127977 read("transforms") ; # see oeis.org/transforms.txt
%p A127977 isA000069 := proc(n) type(wt(n),'odd') ; end proc;
%p A127977 isA027697 := proc(n) isprime(n) and isA000069(n) ; end proc:
%p A127977 isA027699 := proc(n) isprime(n) and not isA000069(n) ; end proc:
%p A127977 odiPi := proc(n) option remember; if n = 0 then 0; else an1 := procname(n-1) ; if isA027697(n) then an1+1 ; else an1 ; end if; end if; end proc:
%p A127977 eviPi := proc(n) option remember; if n = 0 then 0; else an1 := procname(n-1) ; if isA027699(n) then an1+1 ; else an1 ; end if; end if; end proc:
%p A127977 oddPi := proc(n) odiPi(n)-eviPi(n) ; end proc:
%p A127977 A127977 := proc(n) local a,x ; a := 2^(n+1) ; for x from 2^(n-1)+1 to 2^n-1 do a := min(a,oddPi(x)) ; end do: a; end proc:
%p A127977 for n from 5 do print(n,A127977(n)) ; end do; # _R. J. Mathar_, Sep 03 2011
%t A127977 wt[n_] := DigitCount[n, 2, 1];
%t A127977 isA000069[n_] := OddQ[wt[n]];
%t A127977 isA027697[n_] := PrimeQ[n] && isA000069[n];
%t A127977 isA027699[n_] := PrimeQ[n] && !isA000069[n];
%t A127977 odiPi[n_] := odiPi[n] = If[n==0, 0, an1 = odiPi[n-1]; If[isA027697[n], an1+1, an1]];
%t A127977 eviPi[n_] := eviPi[n] = If[n==0, 0, an1 = eviPi[n-1]; If[isA027699[n], an1+1, an1]];
%t A127977 oddPi[n_] := odiPi[n] - eviPi[n];
%t A127977 A127977[n_] := Module[{a, x}, a = 2^(n+1); For[x = 2^(n-1)+1, x <= 2^n-1, x++, a = Min[a, oddPi[x]]]; a];
%t A127977 Table[an = A127977[n]; Print[an]; an, {n, 5, 30}] (* _Jean-François Alcover_, Jan 23 2018, after _R. J. Mathar_ *)
%Y A127977 Cf. A000069, A001969, A027697, A027699, A095005, A095006.
%K A127977 nonn,base
%O A127977 5,3
%A A127977 _Jonathan Vos Post_, Jun 07 2007
%E A127977 Published numbers corrected and checked up to n=23 by _R. J. Mathar_, Sep 03 2011