OFFSET
1,5
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(7) = 2 because the arithmetic progression 3, 5, 7 of A376109(7) = 3 primes ending in 7 has common difference of 5 - 3 = 7 - 5 = 2.
There are two arithmetic progressions of semiprimes of A376109(14) = 3 ending in 14, namely 6, 10, 14 with common difference 4 and 4, 9, 14 with common difference 5, so a(14) = 4.
MAPLE
M:= Array(1..10):
for n from 2 to 100 do
v:= numtheory:-bigomega(n);
if M[v] = 0 then M[v]:= n else M[v]:= M[v], n fi;
od:
for i from 1 to 10 do M[i]:= [M[i]] od:
f:= proc(s) local n, i, m, d, v, j, dm;
m:= 1; dm:= 1;
v:= numtheory:-bigomega(s);
member(s, M[v], n);
for i from n-1 to 1 by -1 do
d:= s - M[v][i];
if s - m*d < M[v][1] then return dm fi;
for j from 2 while ListTools:-BinarySearch(M[v], s-j*d) <> 0 do od:
if j > m then m:= j; dm:= d fi;
od;
dm;
end proc:
f(1):= 1:
map(f, [$1..100]);
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Sep 10 2024
STATUS
approved