login
A376109
a(n) is the length of the longest arithmetic progression ending at n consisting of numbers with the same number of prime factors as n, counted with multiplicity.
2
1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 2, 3, 2, 1, 3, 2, 3, 2, 3, 3, 4, 2, 2, 3, 2, 3, 5, 2, 3, 1, 3, 3, 3, 2, 2, 3, 2, 2, 4, 3, 4, 3, 2, 4, 3, 2, 3, 2, 3, 3, 5, 2, 4, 3, 3, 5, 4, 2, 3, 3, 3, 1, 3, 3, 3, 3, 4, 3, 3, 2, 3, 3, 2, 3, 3, 3, 4, 2, 2, 4, 4, 3, 3, 4, 5, 3, 3, 2, 4, 4, 4, 3, 3, 2, 4, 3, 3
OFFSET
1,3
COMMENTS
a(n) is the greatest k such that there exists d >= 1 with A001222(n-i*d) = A001222(n) for 0 <= i < k.
If m divides n, then a(n) >= a(m).
a(n) = 1 if and only if n is a power of 2.
LINKS
EXAMPLE
a(7) = 3 because 7 is prime and there is an arithmetic progression of 3 primes, namely 3, 5, 7, ending with 7 but no such arithmetic progression of 4 primes.
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;
m:= 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 m fi;
for j from 2 while ListTools:-BinarySearch(M[v], s-j*d) <> 0 do od:
m:= max(m, j);
od;
m;
end proc:
f(1):= 1:
map(f, [$1..100]);
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Sep 10 2024
STATUS
approved