login
A329243
a(n) = Pi(8,3)(prime(n)) + Pi(8,5)(prime(n)) + Pi(8,7)(prime(n)) - 3*Pi(8,1)(prime(n)), where Pi(a,b)(x) denotes the number of primes in the arithmetic progression a*k + b less than or equal to x.
2
0, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8, 9, 10, 11, 8, 9, 10, 7, 4, 5, 6, 7, 8, 5, 6, 7, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 11, 12, 13, 14, 15, 16, 17, 14, 15, 12, 13, 10, 11, 12, 13, 14, 11, 12, 13, 14, 15, 12, 13, 14, 11, 12, 13, 10, 11, 12, 13, 14, 15, 16
OFFSET
1,3
COMMENTS
The initial terms are nonnegative integers, a(n) is negative for some prime(n) ~ 10^28.127. See the comments about "Chebyshev's bias" in A329242.
LINKS
EXAMPLE
For prime(25) = 97, there are 5 primes <= 97 that are congruent to 1 mod 8 (17, 41, 73, 89, 97), 7 primes congruent to 3 mod 8 (3, 11, 19, 43, 59, 67, 83), 6 primes congruent to 5 mod 8 (5, 13, 29, 37, 53, 61), 6 primes congruent to 7 mod 8 (7, 23, 31, 47, 71, 79), so a(25) = 7 + 6 + 6 - 3*5 = 4.
PROG
(PARI) a(n) = my(k=0); forprime(p=3, prime(n), if(p%8==1, k-=3, k++)); k
CROSSREFS
KEYWORD
sign
AUTHOR
Jianing Song, Nov 08 2019
EXTENSIONS
Edited by Peter Munn, Nov 19 2023
STATUS
approved