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.

A182071 Number of primes in the half-open interval [n*sqrt((n-1)/2), (n+1)*sqrt(n/2)).

This page as a plain text file.
%I A182071 #14 Feb 06 2019 22:11:40
%S A182071 0,1,1,2,0,1,1,1,1,1,0,2,0,1,2,1,0,1,2,0,2,1,1,1,1,1,1,2,2,0,0,2,1,1,
%T A182071 1,1,2,1,1,2,0,3,1,1,0,1,2,2,1,1,1,2,2,2,1,0,1,3,0,1,1,2,2,1,1,2,1,2,
%U A182071 1,1,1,2,2,1,3,1,1,2,1,2,1,1,1,1,1,2,2,1,2,2,3,0,1,3,3,0,2,2,1,1,1,2,2,2,1,2,1,1,2,2,2,1,1,3,1,3,0,2,1,2
%N A182071 Number of primes in the half-open interval [n*sqrt((n-1)/2), (n+1)*sqrt(n/2)).
%e A182071 a(1)=0 because are no primes in half-open interval [1*sqrt((1-1)/2), (1+1)*sqrt(1/2)),
%e A182071 a(2)=1 because prime 2 is in half-open interval [2*sqrt((2-1)/2), (2+1)*sqrt(2/2)),
%e A182071 a(3)=1 because primes 3 is in half-open interval [3*sqrt((3-1)/2),(3+1)*sqrt(3/2)),
%e A182071 a(4)=2 because primes 5,7 are in half-open interval [4*sqrt((4-1)/2), (4+1)*sqrt(4/2)).
%p A182071 with(numtheory);
%p A182071 f:=proc(n) local t1,t2,eps;
%p A182071 t1:=floor((n+1)*sqrt(n/2));
%p A182071 if t1 = (n+1)*sqrt(n/2) then t1:=t1-1; fi;
%p A182071 t2:=ceil(n*sqrt((n-1)/2));
%p A182071 eps:=0;
%p A182071 if isprime(t2) then eps:=1; fi;
%p A182071 pi(t1)-pi(t2)+eps;
%p A182071 end;
%p A182071 [seq(f(n),n=1..120)]; # _N. J. A. Sloane_, Apr 26 2012
%Y A182071 Cf. A006002.
%K A182071 nonn
%O A182071 1,4
%A A182071 _Gerasimov Sergey_, Apr 10 2012