A098033 Parity of p*(p+1)/2 for n-th prime p.
1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0
Offset: 1
Examples
a(1) = parity of (2*(2+1)/2 = 3) = 1 (odd).
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
- M. A. Nyblom, On the representation of the integers as a difference of nonconsecutive triangular numbers, Fibonacci Quarterly 39:3 (2001), pp. 256-263.
Programs
-
Maple
seq((ithprime(n) mod 4) mod 3, n = 2..105] # Gary Detlefs, Oct 27 2011
-
Mathematica
Table[ Mod[ Prime[n](Prime[n] + 1)/2, 2], {n, 105}] (* Robert G. Wilson v, Sep 17 2004 *) Mod[(#(#+1))/2,2]&/@Prime[Range[110]] (* Harvey P. Dale, Mar 29 2015 *)
-
PARI
a(n)=prime(n)%4<3 \\ Charles R Greathouse IV, Oct 27 2011
Formula
a(n) = parity of p*(p+1)/2 for n-th prime p.
a(n) = 1 - A100672(n), n > 1. - Steven G. Johnson (stevenj(AT)math.mit.edu), Sep 18 2008
For n > 1, a(n) = (prime(n) mod 4) mod 3. - Gary Detlefs, Oct 27 2011
Extensions
More terms from Robert G. Wilson v, Sep 17 2004
Comments