Determine the minimum value of a positive integer N such that each of N, N+1, N+2, N+3, N+4, and N+5 has the same number of divisors (including 1 and itself.)
d=0; ct=0;
for n=1:9999999
prev=d;
d=length(divisors(n));
if d==prev
ct=ct+1;
else
ct=1;
end
if ct>=6
disp([n-ct+1 n ct])
end
end
finds
28374 through 28379 have the same number of divisors.
Each has 8 divisors as seen by
>> for i=28374:28379 fprintf('%d ',divisors(i)), fprintf('\n')
end
1 2 3 6 4729 9458 14187 28374
1 5 25 125 227 1135 5675 28375
1 2 4 8 3547 7094 14188 28376
1 3 9 27 1051 3153 9459 28377
1 2 7 14 2027 4054 14189 28378
1 13 37 59 481 767 2183 28379
|
Posted by Charlie
on 2023-11-12 08:56:56 |