A063934 Numbers which are either prime or the average of consecutive odd primes.
2, 3, 4, 5, 6, 7, 9, 11, 12, 13, 15, 17, 18, 19, 21, 23, 26, 29, 30, 31, 34, 37, 39, 41, 42, 43, 45, 47, 50, 53, 56, 59, 60, 61, 64, 67, 69, 71, 72, 73, 76, 79, 81, 83, 86, 89, 93, 97, 99, 101, 102, 103, 105, 107, 108, 109, 111, 113, 120, 127, 129, 131, 134, 137, 138
Offset: 1
Keywords
Examples
7 is prime, 9 is the average of 7 and 11, 11 is prime, 12 is the average of 11 and 13; so 7, 9, 11 and 13 are in the sequence.
Links
- Harry J. Smith, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
Function[p, Union@ Join[p, Rest@ Map[Mean, Partition[p, 2, 1]]]]@ Prime@ Range@ 34 (* Michael De Vlieger, May 13 2017 *)
-
PARI
{ for (n=1, 1000, if (n==1, a=2; p=3, if (n%2, a=(q + p=nextprime(q + 1))/2, a=q=p)); write("b063934.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 03 2009
Comments