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.

A336299 (Least prime > prime(n)/2) - (greatest prime < prime(n)/2).

This page as a plain text file.
%I A336299 #16 Dec 07 2020 02:13:37
%S A336299 1,2,2,2,4,4,2,4,4,2,4,4,6,6,2,2,6,6,6,4,2,4,6,6,6,6,6,6,6,6,4,4,6,6,
%T A336299 6,4,6,6,8,8,8,8,4,4,4,4,14,14,14,14,14,14,4,6,6,6,2,10,10,10,6,6,6,6,
%U A336299 4,6,6,6,6,2,10,10,10,2,4,2,12,12,12,12,12
%N A336299 (Least prime > prime(n)/2) - (greatest prime < prime(n)/2).
%e A336299 Prime(3)/2 = 2.5, so that a(3) = 3 - 2 = 1.
%e A336299 Prime(4)/2 = 3.5, so that a(4) = 5 - 3 = 2.
%t A336299 z = 120; t = Table[NextPrime[Prime[n]/2], {n, 3, z}]; (* cf. A039734, A079953 *)
%t A336299 u = NextPrime[t, -1]  (* A336298 *)
%t A336299 t - u  (* A336299 *)
%o A336299 (PARI) a(n) = my(x=prime(n)/2); nextprime(x) - precprime(x); \\ _Michel Marcus_, Nov 18 2020
%Y A336299 Cf. A000040, A039734, A336298.
%K A336299 nonn
%O A336299 3,2
%A A336299 _Clark Kimberling_, Nov 16 2020