OFFSET
1,2
COMMENTS
Absolute value is A177718.
FORMULA
EXAMPLE
The binary expansion of 83 is (1,0,1,0,0,1,1), and 83 is the 23rd prime, so a(23) = 4 - 3 = 1.
MATHEMATICA
Table[DigitCount[Prime[n], 2, 1]-DigitCount[Prime[n], 2, 0], {n, 100}]
CROSSREFS
Restriction of A145037 to the primes.
The unsigned version is A177718.
- Positions of positive terms are indices of the primes A095070.
- Positions of negative terms are indices of the primes A095071.
- Positions of nonnegative terms are indices of the primes A095074.
- Positions of nonpositive terms are indices of the primes A095075.
A070939 gives length of binary expansion.
A372471 lists the binary indices of each prime.
KEYWORD
sign
AUTHOR
Gus Wiseman, May 13 2024
STATUS
approved