A145025 Numbers which are the average of two consecutive odd primes (A024675) together with primes which are the average of the previous prime and the following prime (A006562).
4, 5, 6, 9, 12, 15, 18, 21, 26, 30, 34, 39, 42, 45, 50, 53, 56, 60, 64, 69, 72, 76, 81, 86, 93, 99, 102, 105, 108, 111, 120, 129, 134, 138, 144, 150, 154, 157, 160, 165, 170, 173, 176, 180, 186, 192, 195, 198, 205, 211, 217, 225, 228, 231, 236, 240, 246, 254, 257, 260
Offset: 1
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Maple
Primes:= select(isprime, [seq(i,i=3..1000,2)]): nprimes:= nops(Primes): A024675:= {seq((Primes[i]+Primes[i+1])/2, i=1..nprimes-1)}: L:= Primes[1..-3]+Primes[3..-1]: A006562:=zip((s,t) -> if 2*s=t then s else NULL fi, Primes[2..-2],L): sort(convert(convert(A006562,set) union A024675, list)); # Robert Israel, Nov 20 2016
-
Mathematica
Union[Select[Map[Mean@ {First@ #, Last@ #} &, Partition[#, 3, 1]], PrimeQ], Map[Mean, Partition[#, 2, 1]]] &@ Prime@ Range[2, 56] (* Michael De Vlieger, Jan 31 2019 *)
-
PARI
for(n=2,999,n-precprime(n-1)==nextprime(n+1)-n&&print1(n",")) \\ M. F. Hasler, Jun 01 2013
Extensions
Entry revised by N. J. A. Sloane, Mar 24 2017, replacing old definition with definition from M. F. Hasler
Comments