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.

A373888 a(n) is the length of the longest arithmetic progression of primes ending with prime(n).

This page as a plain text file.
%I A373888 #27 Aug 13 2024 09:10:26
%S A373888 1,2,2,3,3,2,3,3,4,5,3,2,4,4,3,5,4,3,3,3,3,4,4,3,4,4,4,4,3,4,5,5,3,4,
%T A373888 4,4,6,4,4,5,3,4,4,4,5,4,3,4,5,4,4,4,4,5,6,4,4,5,3,4,5,5,4,6,4,4,4,3,
%U A373888 4,4,6,4,4,5,3,4,5,5,4,4,4,5,4,4,4,5,5,4,4,6,4,5,4,4,3,4,6,5,4
%N A373888 a(n) is the length of the longest arithmetic progression of primes ending with prime(n).
%C A373888 a(n) is the greatest k such that there exists d > 0 such that A000040(n) - j*d is prime for j = 0 .. k-1.
%C A373888 The first appearance of m in this sequence is at A000720(A005115(m)).
%C A373888 Conjectures: a(n) >= 3 for n >= 13.
%C A373888 Limit_{n -> oo} a(n) = oo.
%H A373888 Robert Israel, <a href="/A373888/b373888.txt">Table of n, a(n) for n = 1..10000</a>
%e A373888 a(4) = 3 because the 4th prime is 7 and there is an arithmetic progression of 3 primes ending in 7, namely 3, 5, 7, and no such arithmetic progression of 4 primes.
%p A373888 f:= proc(n) local s,i,m,d,j;
%p A373888   m:= 1;
%p A373888   s:= ithprime(n);
%p A373888   for i from n-1 to 1 by -1 do
%p A373888     d:= s - ithprime(i);
%p A373888     if s - m*d < 2 then return m fi;
%p A373888     for j from 2 while isprime(s-j*d) do od;
%p A373888     m:= max(m, j);
%p A373888   od;
%p A373888   m
%p A373888 end proc:
%p A373888 map(f, [$1..100]);
%Y A373888 Cf. A000040, A000720, A005115, A373887.
%K A373888 nonn
%O A373888 1,2
%A A373888 _Robert Israel_, Aug 11 2024