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.

A267135 a(n) = n minus the number of primes of form 4m + 1 that are less than n-th prime of form 4m + 3.

This page as a plain text file.
%I A267135 #17 Sep 18 2018 04:49:48
%S A267135 1,1,2,1,2,2,1,2,2,2,3,3,4,2,3,2,3,3,3,3,4,4,4,3,4,5,6,5,5,5,5,4,4,5,
%T A267135 4,4,3,4,4,5,2,2,2,3,1,2,3,4,5,6,7,6,6,6,6,6,6,6,5,6,6,7,7,5,6,5,6,6,
%U A267135 7,8,5,4,4,5,5,4,5,4,5,6,7,8,6,6,7,7,8,6,6,6,6,6,6,7,6,5,5,5,6,6
%N A267135 a(n) = n minus the number of primes of form 4m + 1 that are less than n-th prime of form 4m + 3.
%C A267135 a(25191) = -3 is the first negative term. - _Robert Israel_, Jan 12 2016
%H A267135 Robert Israel, <a href="/A267135/b267135.txt">Table of n, a(n) for n = 1..10000</a>
%H A267135 A. Granville and G. Martin, <a href="http://arxiv.org/abs/math/0408319">Prime number races</a>, Amer. Math. Monthly, 113 (No. 1, 2006), 1-33.
%p A267135 N:= 10000: # to use primes up to N P1:= select(isprime, [seq(i,i=1..N,4)]):
%p A267135 P3:= select(isprime, [seq(i,i=3..N,4)]):
%p A267135 V:= Vector(N):
%p A267135 for n from 2 to nops(P1) do
%p A267135   V[P1[n-1]..P1[n]-1]:=n-1
%p A267135 od:
%p A267135 V[P1[nops(P1)]..N]:= nops(P1);
%p A267135 seq(n - V[P3[n]],n=1..nops(P3)); # _Robert Israel_, Jan 11 2016
%t A267135 nn = 10000;
%t A267135 P1 = Select[Range[1, nn, 4], PrimeQ];
%t A267135 P3 = Select[Range[3, nn, 4], PrimeQ];
%t A267135 V = Table[0, nn];
%t A267135 For[n = 2, n <= Length[P1], n++,
%t A267135   V[[P1[[n-1]] ;; P1[[n]]-1]] = n-1
%t A267135 ];
%t A267135 V[[P1[[Length[P1]]] ;; nn]] = Length[P1];
%t A267135 Table[n - V[[P3[[n]]]], {n, 1, Length[P3]}] (* _Jean-François Alcover_, Sep 18 2018, after _Robert Israel_ *)
%Y A267135 Cf. A002144, A002145, A007350.
%K A267135 sign
%O A267135 1,3
%A A267135 _Gionata Neri_, Jan 10 2016