OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
The first four primes of the form 8k - 1 are 7, 23, 31, 47. The first four primes of the form 8k + 1 are 17, 41, 73, 89.
Thus a(1) = 7 + 17 = 24.
a(2) = 23 + 41 = 64.
a(3) = 31 + 73 = 104.
a(4) = 47 + 89 = 136.
MATHEMATICA
thresh = 100; A007522 = Select[8Range[thresh] - 1, PrimeQ]; A007519 = Select[8Range[thresh] + 1, PrimeQ]; preExh = Min[Length[A007522], Length[A007519]]; Take[A007522, preExh] + Take[A007519, preExh]
Module[{nn=300, p1, p7, len}, p1=Select[Prime[Range[nn]], IntegerQ[(#-1)/8]&]; p7=Select[Prime[Range[nn]], IntegerQ[(#-7)/8]&]; len=Min[ Length[ p1], Length[ p7]]; Total/@Thread[{Take[p1, len], Take[p7, len]}]] (* Harvey P. Dale, May 26 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved