login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Partial sums of A070748.
1

%I #27 Aug 08 2020 01:30:34

%S 1,2,1,2,1,2,1,2,1,0,-1,-2,-3,-4,-3,-2,-1,-2,-3,-2,-3,-4,-3,-2,-1,0,1,

%T 2,3,2,3,2,1,2,1,2,1,0,-1,-2,-1,-2,-1,-2,-1,-2,-3,-2,-1,0,1,2,3,2,1,0,

%U -1,0,1,0,1,0,-1,0,-1,0,-1,-2,-1,-2

%N Partial sums of A070748.

%C This sequence counts what the prime number distribution is in the intervals where the sine function gives different signs: if a(n) is positive, it means that up to n more primes fall into the interval (2k*Pi, (2k+1)*Pi) than in ((2k+1)*Pi, (2k+2)*Pi) for k=0,1,2,3... When a(n) is zero, the first n primes are distributed equally between these intervals.

%H Bence BernĂ¡th, <a href="/A333688/b333688.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = Sum_{k=1..n} A070748(k). - _Sean A. Irvine_, May 02 2020

%e For n=4, a(4) = signum(sin(2)) + signum(sin(3)) + signum(sin(5)) + signum(sin(7)) = 1 + 1 - 1 + 1 = 2.

%t Accumulate @ Table[Sign @ Sin @ Prime[i], {i, 1, 70}] (* _Amiram Eldar_, Apr 02 2020 *)

%o (MATLAB)

%o primes_up_to=1000;

%o sequence(1)=1;

%o for n=2:1:primes_up_to

%o if isprime(n)

%o sequence(numel(primes(n)))=sum(sign(sin(primes(n))));

%o end

%o end

%o result=transpose((sequence));

%o (PARI) a(n) = sum(k=1, n, sign(sin(prime(k)))); \\ _Michel Marcus_, May 03 2020

%Y Cf. A007504, A070748.

%K sign

%O 1,2

%A _Bence BernĂ¡th_, Apr 02 2020