In how many ways can 7^23 be expressed as a product of five natural numbers?
Also repeat the problem for 7^22.
clearvars
sol=[];
for p=5:23
ct=0;
for a=0:p/5
for b=a:(p-a)/4
for c=b:(p-a-b)/3
for d=c:(p-a-b-c)/2
e=p-a-b-c-d ;
ct=ct+1;
end
end
end
end
disp([p ct])
sol(end+1)=ct;
end
fprintf('%d,',sol)
fprintf('\n')
finds the results for all the powers of 7 from 5 to 23 by finding all the combinations of exponents, assuming that combinations rather than permutations are what is asked for:
5 7
6 10
7 13
8 18
9 23
10 30
11 37
12 47
13 57
14 70
15 84
16 101
17 119
18 141
19 164
20 192
21 221
22 255 part 2 answer
23 291 part 1 answer
The sequence is found in OEIS A001401.
|
Posted by Charlie
on 2025-02-28 09:42:09 |