OFFSET
1,9
LINKS
R. H. Hudson and A. Brauer, On the exact number of primes in the arithmetic progressions 4n +/- 1 and 6n +/- 1, J. reine angew. Math., 291 (1977), 23-29.
EXAMPLE
MAPLE
f:= proc(t) `if`(isprime(6*t-1), 1, 0) - `if`(isprime(6*t+1), 1, 0) end proc:
ListTools:-PartialSums(map(f, [$1..100])); # Robert Israel, Feb 19 2019
MATHEMATICA
Accumulate@ Boole@ PrimeQ[6 Range@ # - 1] - Accumulate@ Boole@ PrimeQ[6 Range@ # + 1] &@ 60 (* Michael De Vlieger, Jan 27 2019 *)
PROG
(PARI)
isp(n) = isprime(6*n+1); \\ A167021
ism(n) = isprime(6*n-1); \\ A167020
psisp(n) = sum(k=1, n, isp(k)); \\ A172104
psism(n) = sum(k=1, n, ism(k)); \\ A172103
a(n) = psism(n) - psisp(n); \\ Michel Marcus, Jan 18 2019
CROSSREFS
KEYWORD
sign
AUTHOR
Torlach Rush, Jan 01 2019
EXTENSIONS
More terms from Michel Marcus, Feb 01 2019
STATUS
approved