A373887 a(n) is the length of the longest arithmetic progression of semiprimes ending in the n-th semiprime.
1, 2, 2, 2, 3, 2, 3, 3, 2, 3, 3, 3, 3, 3, 2, 4, 3, 3, 4, 3, 5, 3, 3, 4, 3, 3, 4, 3, 4, 5, 4, 4, 3, 3, 5, 3, 4, 4, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 5, 3, 3, 4, 5, 4, 4, 3, 4, 3, 4, 4, 4, 4, 3, 4, 5, 4, 4, 3, 4, 4, 4, 5, 3, 5, 6, 4, 4, 4, 4, 4, 4, 5, 4, 5, 5, 3, 3, 4, 4, 5, 5, 4, 4, 4, 4, 4, 5, 4, 5
Offset: 1
Keywords
Examples
a(5) = 3 because the 5th semiprime is A001358(5) = 14 and there is an arithmetic progression of 3 semiprimes ending in 14, namely 4, 9, 14, and no such arithmetic progression of 4 semiprimes.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
S:= select(t -> numtheory:-bigomega(t)=2, [$1..10^5]): f:= proc(n) local s,i,m,d,j; m:= 1; s:= S[n]; for i from n-1 to 1 by -1 do d:= s - S[i]; if s - m*d < 4 then return m fi; for j from 2 while ListTools:-BinarySearch(S,s-j*d) <> 0 do od; m:= max(m, j); od; m; end proc: map(f, [$1..100]);
Comments