A004881 Numbers that are the sum of at most 8 nonzero 8th powers.
0, 1, 2, 3, 4, 5, 6, 7, 8, 256, 257, 258, 259, 260, 261, 262, 263, 512, 513, 514, 515, 516, 517, 518, 768, 769, 770, 771, 772, 773, 1024, 1025, 1026, 1027, 1028, 1280, 1281, 1282, 1283, 1536, 1537, 1538, 1792, 1793, 2048, 6561, 6562, 6563, 6564, 6565, 6566
Offset: 1
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000
Crossrefs
Column k=8 of A336820.
Programs
-
Maple
b:= proc(n, i, t) option remember; n=0 or i>0 and t>0 and (b(n, i-1, t) or i^8<=n and b(n-i^8, 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, 8), 8) do od; k end: seq(a(n), n=1..60); # 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^8 <= n && b[n - i^8, i, t - 1]); a[n_] := a[n] = (For[k = 1 + If[n == 1, -1, a[n - 1]], !b[k, k^(1/8) // Floor, 8], k++]; k); Array[a, 60] (* Jean-François Alcover, Apr 06 2017, after Alois P. Heinz *)
Extensions
More terms from Alois P. Heinz, Sep 16 2016