login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A199339 a(n) = number of primes with an even digit sum among the first n primes minus the number with an odd digit sum. 1
1, 0, -1, -2, -1, 0, 1, 2, 1, 0, 1, 2, 1, 0, -1, 0, 1, 0, -1, 0, 1, 2, 1, 0, 1, 2, 3, 4, 5, 4, 5, 4, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 0, -1, -2, -1, -2, -3, -4, -3, -2, -3, -2, -1, -2, -3, -2, -1, -2, -3, -2, -1, -2, -3, -4, -5, -6, -5, -4, -5, -6, -5, -6 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
Christian Mauduit and Joël Rivat, Sur un problème de Gelfond: la somme des chiffres des nombres premiers, Annals Math., 171 (2010), 1591-1646.
FORMULA
a(n)=sum_{k=1...n} (-1)^A007605(n).
Equals A200262 - A200264.
EXAMPLE
a(1)=1 because the first prime has an even sum of digits.
a(2)=0, a(3)=-1, a(4)=-2 because the following primes (3,5,7) have odd sum of digits.
a(5)=-1, a(6)=0, a(7)=1, a(8)=2 because the 5th, 6th, 7th and 8th prime (11, 13, 17, 19) have an even sum of digits.
MATHEMATICA
a[1] := 1; a[n_] := a[n] = a[n - 1] + (-1)^(Plus@@IntegerDigits[Prime[n]]); Table[a[n], {n, 74}] (* Alonso del Arte, Nov 14 2011 *)
PROG
(PARI) s=0; vector(90, n, s+=(-1)^A007953(prime(n)))
CROSSREFS
Sequence in context: A366128 A191329 A096661 * A323202 A118825 A007877
KEYWORD
sign,base
AUTHOR
M. F. Hasler, Nov 14 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 12 12:13 EDT 2024. Contains 374247 sequences. (Running on oeis4.)