login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A004844
Numbers that are the sum of at most 4 positive 5th powers.
1
0, 1, 2, 3, 4, 32, 33, 34, 35, 64, 65, 66, 96, 97, 128, 243, 244, 245, 246, 275, 276, 277, 307, 308, 339, 486, 487, 488, 518, 519, 550, 729, 730, 761, 972, 1024, 1025, 1026, 1027, 1056, 1057, 1058, 1088, 1089, 1120, 1267, 1268, 1269, 1299, 1300, 1331, 1510, 1511
OFFSET
1,3
LINKS
MAPLE
b:= proc(n, i, t) option remember; n=0 or i>0 and t>0
and (b(n, i-1, t) or i^5<=n and b(n-i^5, i, t-1))
end:
a:= proc(n) option remember; local k;
for k from 1+ `if`(n=1, -1, a(n-1))
while not b(k, iroot(k, 5), 4) do od; k
end:
seq(a(n), n=1..50); # Alois P. Heinz, Sep 16 2016
MATHEMATICA
b[n_, i_, t_] := b[n, i, t] = n==0 || i>0 && t>0 && (b[n, i-1, t] || i^5 <= n && b[n - i^5, i, t-1]);
a[n_] := a[n] = Module[{k}, For[k = 1+If[n==1, -1, a[n-1]], !b[k, Floor[ k^(1/5)], 4], k++]; k];
Array[a, 50] (* Jean-François Alcover, Nov 16 2020, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A250189 A255253 A076592 * A037324 A067242 A028354
KEYWORD
nonn
STATUS
approved