login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A339500 Maximum length of sequences of prime numbers that start with prime(n) and are arithmetic progressions of common difference less than prime(n). 2
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, 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, 4, 4, 5, 6, 5, 4, 5, 5, 6, 6, 5, 9, 5, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
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.
a(12) = 5 since prime(12) = 37 and 67, 97, 127 and 157 are also primes in arithmetic progression of common difference 30 < 37.
PROG
(PARI) A339500(n)= {
my(p=prime(n), bp, bk);
forprime(np=p+1, 2*p, for(k=2, +oo, if(!isprime(p+k*(np-p)), if(k>bk, bk=k; bp=np; ); break); ); );
return(bk);
}
CROSSREFS
Sequence in context: A130799 A243519 A278102 * A106383 A175794 A324389
KEYWORD
nonn,easy
AUTHOR
François Marques, Dec 07 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 12:42 EDT 2024. Contains 371938 sequences. (Running on oeis4.)