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.

A359273 a(n) = least positive integer k such that (prime(n+k)-prime(n))/n is an integer.

This page as a plain text file.
%I A359273 #14 Mar 24 2025 05:56:02
%S A359273 1,1,2,1,6,2,4,6,4,7,5,6,6,6,13,10,14,4,23,12,16,4,42,6,20,5,10,10,10,
%T A359273 10,23,6,24,6,37,12,38,14,40,22,151,6,16,16,46,22,60,10,49,25,65,43,
%U A359273 16,18,18,27,19,38,56,19,144,30,21,21,21,10,42,32,66
%N A359273 a(n) = least positive integer k such that (prime(n+k)-prime(n))/n is an integer.
%e A359273 a(5) = 6 because 5 divides 20, which is prime(5+6) - prime(5), and if 0 < k < 6, then 5 does not divide prime(5+k) - prime(5).
%p A359273 f:= proc(n) local p,k,q;
%p A359273   p:= ithprime(n); q:= p;
%p A359273   for k from 1 do
%p A359273     q:= nextprime(q);
%p A359273     if (q - p) mod n = 0 then return k fi;
%p A359273   od
%p A359273 end proc:
%p A359273 map(f, [$1..100]); # _Robert Israel_, Jan 26 2023
%t A359273 p[n_] := Prime[n];
%t A359273 a[n_] := Select[Range[1000], IntegerQ[(p[n + #] - p[n])/n] &, 1]
%t A359273 Flatten[Table[a[n], {n, 1, 130}]]
%Y A359273 Cf. A000040, A072063.
%K A359273 nonn
%O A359273 1,3
%A A359273 _Clark Kimberling_, Jan 26 2023