OFFSET
1,2
COMMENTS
a(n) either equals 0 or belongs to A090403.
EXAMPLE
a(2) = 5 because beginning with the second prime, 3, there is a run of three prime, (3,5,7) the average and median of which is 5.
a(5) = 0 because there does not exist a run of 2k + 1 primes such that the arithmetic mean and the median are the same.
MATHEMATICA
f[n_] := Block[{k = 1, p = 0}, While[k < 10^4, If[(Plus @@ Table[Prime[i], {i, n, n + 2k}]) == (2k + 1)Prime[n + k], p = Prime[n + k]]; k++ ]; p]; Table[ f[n], {n, 74}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Jul 02 2004
STATUS
approved