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.

Showing 1-7 of 7 results.

A333688 Partial sums of A070748.

Original entry on oeis.org

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, 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, -1, 0, 1, 0, 1, 0, -1, 0, -1, 0, -1, -2, -1, -2
Offset: 1

Views

Author

Bence Bernáth, Apr 02 2020

Keywords

Comments

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.

Examples

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

Crossrefs

Programs

  • MATLAB
    primes_up_to=1000;
    sequence(1)=1;
    for n=2:1:primes_up_to
            if isprime(n)
                sequence(numel(primes(n)))=sum(sign(sin(primes(n))));
            end
    end
    result=transpose((sequence));
    
  • Mathematica
    Accumulate @ Table[Sign @ Sin @ Prime[i], {i, 1, 70}] (* Amiram Eldar, Apr 02 2020 *)
  • PARI
    a(n) = sum(k=1, n, sign(sin(prime(k)))); \\ Michel Marcus, May 03 2020

Formula

a(n) = Sum_{k=1..n} A070748(k). - Sean A. Irvine, May 02 2020

A070750 0 if n-th prime is even, 1 if n-th prime is == 1 (mod 4), and -1 if n-th prime is == 3 (mod 4).

Original entry on oeis.org

0, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1
Offset: 1

Views

Author

Reinhard Zumkeller, May 04 2002

Keywords

Comments

Also, sin(prime(n)*Pi/2), where prime(n) = A000040(n), Pi=3.1415... (original definition).
Also imaginary part of primes mapped as defined in A076340, A076341: a(n) = A076341(A000040(n)), real part = A076342.
Legendre symbol (-1/prime(n)) for n > 1. - T. D. Noe, Nov 05 2003
For n > 1, let p = prime(n) and m = (p-1)/2. Then c(m) - a(n) == 0 (mod p), where c(m) = (2*m)!/(m!)^2 = A000984(m) is the central binomial coefficient. [Proof: By definition, c(m)*(m!)^2 - (p-1)! = 0 and therefore c(m)*(m!)^2*(-1)^(m+1) - (p-1)!*(-1)^(m+1) = 0. Now apply Wilson's theorem, (p-1)! == 1 (mod p), and its corollary, (m!)^2 == (-1)^(m+1) (mod p), and finally use the formula by T. D. Noe listed below to replace (-1)^m with a(n).] Similarly, C_m - 2*a(n) == 0 (mod p), with C_m = A000108(m) being the m-th Catalan number. [Proof: By definition, C_m*(p+1)*(m!)^2 - 2*(p-1)! = 0. The result follows proceeding as in the first proof.] - Stanislav Sykora, Aug 11 2014

Examples

			p = 4*k+1 (see A002144): a(p) = sin((4*k+1)*Pi/2) = sin(2*k*Pi + Pi/2) = sin(Pi/2) = 1.
p = 4*k+3 (see A002145): a(p) = sin((4*k+3)*Pi/2) = sin(2*k*Pi + 3*Pi/2) = sin(3*Pi/2) = -1.
		

Crossrefs

Programs

Formula

a(n) = 2 - prime(n) mod 4 = 2 - A039702(n).
a(n) = (-1)^((prime(n)-1)/2) for n > 1. - T. D. Noe, Nov 05 2003
From Amiram Eldar, Dec 24 2022: (Start)
Product_{n>=1} (1 - a(n)/prime(n)) = 4/Pi (A088538).
Product_{n>=1} (1 + a(n)/prime(n)) = 2/Pi (A060294). (End)

Extensions

Wording of definition changed by N. J. A. Sloane, Jun 21 2015

A070747 a(n) = signum(sin(n)), where signum=A057427.

Original entry on oeis.org

0, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, 1
Offset: 0

Views

Author

Reinhard Zumkeller, May 04 2002

Keywords

Comments

a(n) <> 0 for n>0.

Examples

			For n=10: sin(10) = sin(10-2*Pi) < 0, as Pi < 10-2*Pi < 2*Pi, therefore a(10) = signum(sin(10)) = -1.
		

Crossrefs

Programs

Formula

a(n) = (-1)^A032615(n) for n>0. - Michel Marcus, Mar 20 2021

A070753 Primes p such that sin(p) < 0.

Original entry on oeis.org

5, 11, 17, 23, 29, 31, 37, 41, 43, 61, 67, 73, 79, 113, 131, 137, 149, 157, 163, 167, 173, 181, 193, 199, 211, 251, 257, 263, 269, 281, 293, 307, 313, 331, 337, 349, 383, 389, 401, 419, 431, 433, 439, 443, 457, 463, 487, 521
Offset: 1

Views

Author

Reinhard Zumkeller, May 04 2002

Keywords

Comments

A070748(A049084(a(n))) = A070747(a(n)) = -1.

Crossrefs

Cf. A070754, A070748, A002145 (sin((Pi/2)*p) < 0 instead of sin(p) < 0), A070751.

Programs

A070754 Primes p such that sin(p) > 0.

Original entry on oeis.org

2, 3, 7, 13, 19, 47, 53, 59, 71, 83, 89, 97, 101, 103, 107, 109, 127, 139, 151, 179, 191, 197, 223, 227, 229, 233, 239, 241, 271, 277, 283, 311, 317, 347, 353, 359, 367, 373, 379, 397, 409, 421, 449, 461, 467, 479, 491, 499, 503
Offset: 1

Views

Author

Reinhard Zumkeller, May 04 2002

Keywords

Comments

A070748(A049084(a(n))) = A070747(a(n)) = 1.

Crossrefs

Cf. A070753, A070748, A002144 (sin((Pi/2)*p) > 0 instead of sin(p) > 0), A070752.

Programs

A070749 Nearest integer to sin(prime(n)), prime=A000040.

Original entry on oeis.org

1, 0, -1, 1, -1, 0, -1, 0, -1, -1, 0, -1, 0, -1, 0, 0, 1, -1, -1, 1, -1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, -1, -1, 1, -1, 0, 0, 0, 0, 0, 0, -1, 1, -1, 1, -1, 0, 0, 1, 0, 0, 0, 1, 0, -1, -1, -1, 1, 1, -1, 0, -1, -1, 0, -1, 0, -1, -1, 1, 0, 1, 1, 1, 1, 1, 0, -1, 1, -1, 1, -1, 0, -1, -1, -1, 0, 0, -1, 1, -1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, -1, -1, 0, -1, -1, 0, 1, 1
Offset: 1

Views

Author

Reinhard Zumkeller, May 04 2002

Keywords

Crossrefs

Extensions

More terms from Matthew Conroy, Jan 16 2006

A181188 Primes at which the prime number race between the two prime classes with different sign of sin(prime(.)) changes leader.

Original entry on oeis.org

31, 101, 167, 229, 269, 271, 307, 311, 313, 317, 331, 359, 439, 479, 487, 491, 691, 787, 797, 3739, 3761, 3821, 4019, 4093, 4153, 4231, 4241, 4243, 4253, 5839, 5843, 5857, 5861, 6367, 6469, 6473, 6553, 6637, 6653, 6673, 6679, 7121, 7219, 7297, 7307, 7309, 7351, 7561, 7583, 7603, 7607, 7681, 8311
Offset: 1

Views

Author

Mikhail Gaichenkov, Oct 09 2010

Keywords

Comments

Split the prime numbers into A070754 and A070753 according to the sign of the sine function:
2, 3, 7, 13, 19| 47, 53, 59, 71, 83, 89, 97,101|103,107,109,127,139,151|179,191,197,223,...
5, 11, 17, 23, 29| 31, 37, 41, 43, 61, 67, 73, 79|113,131,137,149,157,163|167,173,181,193,199,...
Comparison of A070754(i) with A070753(i) defines a prime number race. The leader chances at places i where sign( A070754(i)-A070753(i) ) <> sign( A070754(i+1)-A070753(i+1) ) indicated by the vertical bars above.
An equivalent observation is that the partial sum s(k) := sum_{i=1..k} A070748(i) has zeros at prime(k)= 29, 101, 163, 229, 263, 271,...
The sequence contains each prime(k+1) where s(k) >=0 and s(k+1)<0 or s(k) <0 and s(k+1)>=0. Cases where s(k) touches zero without actually flipping the sign are not relevant.

Programs

  • Maple
    isA070753 := proc(n) is(sin(ithprime(n))<0) ; end proc:
    A070748 := proc(n) option remember; if isA070753(n) then -1 ; else 1; end if; end proc:
    A070748s := proc(n) add( A070748(i),i=1..n) ; end proc:
    for n from 1 to 10000 do if A070748s(n) >= 0 and A070748s(n+1) < 0 or A070748s(n) <0 and A070748s(n+1) >= 0 then printf("%d,",ithprime(n+1)) ; end if;end do:
  • PARI
    s=0; p=0; while(1, p=nextprime(p+1); s+=(-1)^(p\Pi); if(s<=-7568,print1(p,", ")))
    
  • PARI
    s=0;forprime(p=2,2000,s+=(-1)^(p\Pi);print1(s,", "))
Showing 1-7 of 7 results.