cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

This page as a plain text file.
%I A145025 #45 Feb 02 2019 04:25:08
%S A145025 4,5,6,9,12,15,18,21,26,30,34,39,42,45,50,53,56,60,64,69,72,76,81,86,
%T A145025 93,99,102,105,108,111,120,129,134,138,144,150,154,157,160,165,170,
%U A145025 173,176,180,186,192,195,198,205,211,217,225,228,231,236,240,246,254,257,260
%N 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).
%C A145025 Numbers n such that prevprime(n) + nextprime(n) = 2n. - _Wesley Ivan Hurt_, May 13 2017
%H A145025 Robert Israel, <a href="/A145025/b145025.txt">Table of n, a(n) for n = 1..10000</a>
%p A145025 Primes:= select(isprime, [seq(i,i=3..1000,2)]):
%p A145025 nprimes:= nops(Primes):
%p A145025 A024675:= {seq((Primes[i]+Primes[i+1])/2, i=1..nprimes-1)}:
%p A145025 L:= Primes[1..-3]+Primes[3..-1]:
%p A145025 A006562:=zip((s,t) -> if 2*s=t then s else NULL fi, Primes[2..-2],L):
%p A145025 sort(convert(convert(A006562,set) union A024675, list)); # _Robert Israel_, Nov 20 2016
%t A145025 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 *)
%o A145025 (PARI) for(n=2,999,n-precprime(n-1)==nextprime(n+1)-n&&print1(n",")) \\ _M. F. Hasler_, Jun 01 2013
%Y A145025 Equals A024675 U A006562. - _M. F. Hasler_, Jun 01 2013
%K A145025 nonn
%O A145025 1,1
%A A145025 _Vladimir Joseph Stephan Orlovsky_, Sep 29 2008
%E A145025 Entry revised by _N. J. A. Sloane_, Mar 24 2017, replacing old definition with definition from _M. F. Hasler_