login
A261225
n minus the number of positive cubes needed to sum to n using the greedy algorithm: a(n) = n - A055401(n).
9
0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 14, 14, 14, 21, 21, 21, 26, 26, 26, 26, 26, 26, 26, 26, 33, 33, 33, 33, 33, 33, 33, 33, 40, 40, 40, 40, 40, 40, 40, 40, 47, 47, 47, 52, 52, 52, 52, 52, 52, 52, 52, 59, 59, 63, 63, 63, 63, 63, 63, 63, 63, 70, 70, 70, 70, 70, 70, 70, 70, 77, 77, 77, 77, 77, 77, 77, 77, 84, 84, 84, 89
OFFSET
0,9
LINKS
FORMULA
a(n) = n - A055401(n).
As a recurrence:
a(0) = 0; for n >= 1, a(n) = -1 + A048762(n) + a(n-A048762(n)). [Where A048762(n) gives the largest cube <= n.]
EXAMPLE
a(8) = 7, because when the greedy algorithm partitions 8 into cubes, it first finds 8 (= 2*2*2), thus A055401(8) = 1, and 8-1 = 7.
PROG
(Scheme, two variants)
(define (A261225 n) (- n (A055401 n)))
(definec (A261225 n) (if (zero? n) n (+ -1 (A048762 n) (A261225 (- n (A048762 n))))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 16 2015
STATUS
approved