Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #23 Dec 26 2020 21:12:04
%S 2,3,2,3,4,2,4,3,3,3,3,5,4,4,4,4,4,4,4,5,3,4,4,3,4,4,5,6,3,5,4,4,5,3,
%T 4,5,6,4,4,4,4,4,4,4,4,3,3,5,4,3,4,6,4,4,6,5,4,4,5,6,4,4,5,4,4,4,6,4,
%U 4,4,5,6,5,4,5,5,6,6,5,9,5,4
%N Maximum length of sequences of prime numbers that start with prime(n) and are arithmetic progressions of common difference less than prime(n).
%e a(4) = 3 since 7 is the fourth prime number and 7, 13 and 19 are primes in arithmetic progression of common difference equal to 6 and there is no longer arithmetic sequence starting with 7 of common difference < 7 which contains only prime numbers.
%e a(12) = 5 since prime(12) = 37 and 67, 97, 127 and 157 are also primes in arithmetic progression of common difference 30 < 37.
%o (PARI) A339500(n)= {
%o my(p=prime(n), bp, bk);
%o forprime(np=p+1, 2*p, for(k=2, +oo, if(!isprime(p+k*(np-p)), if(k>bk, bk=k; bp=np;); break); ); );
%o return(bk);
%o }
%Y Cf. A000040, A339501.
%K nonn,easy
%O 1,1
%A _François Marques_, Dec 07 2020