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.

A375386 a(n) is the common difference in the longest arithmetic progression of primes ending in prime(n). If there is more than one such arithmetic progression, the smallest difference is chosen.

This page as a plain text file.
%I A375386 #8 Aug 14 2024 08:33:53
%S A375386 1,2,2,4,2,6,6,6,6,12,6,12,12,18,12,6,24,24,12,6,6,12,18,18,30,30,18,
%T A375386 6,30,30,30,24,36,48,24,30,12,18,42,6,54,54,42,48,60,30,42,30,66,42,
%U A375386 66,30,60,30,12,6,30,48,84,60,60,78,60,102,60,60,30,78,36,60,90,18,90,6,72,96,30,54
%N A375386 a(n) is the common difference in the longest arithmetic progression of primes ending in prime(n).  If there is more than one such arithmetic progression, the smallest difference is chosen.
%C A375386 a(n) is the smallest common difference in an arithmetic progression of A373888(n) primes ending in prime(n).
%C A375386 a(n) is divisible by all primes < min(A373888(n) + 1, prime(n) - (A373888(n)-1)*a(n)).
%H A375386 Robert Israel, <a href="/A375386/b375386.txt">Table of n, a(n) for n = 2..10000</a>
%e A375386 a(4) = 2 because the 4th prime is 7 and the arithmetic progression of 3 primes ending in 7, namely 3, 5, 7, has common difference 2.
%p A375386 f:= proc(n) local s, i, m, dd, d, j;
%p A375386   m:= 1;
%p A375386   s:= ithprime(n);
%p A375386   for i from n-1 to 1 by -1 do
%p A375386     d:= s - ithprime(i);
%p A375386     if s - m*d < 2 then return dd fi;
%p A375386     for j from 2 while isprime(s-j*d) do od;
%p A375386     if j > m then m:= j; dd:= d fi;
%p A375386   od;
%p A375386   dd
%p A375386 end proc:
%p A375386 map(f, [$2..100]);
%Y A375386 Cf. A000040, A373888.
%K A375386 nonn,look
%O A375386 2,2
%A A375386 _Robert Israel_, Aug 13 2024