login
A260740
a(n) = n minus the number of positive squares needed to sum to n using the greedy algorithm: a(n) = n - A053610(n).
9
0, 0, 0, 0, 3, 3, 3, 3, 6, 8, 8, 8, 8, 11, 11, 11, 15, 15, 15, 15, 18, 18, 18, 18, 21, 24, 24, 24, 24, 27, 27, 27, 27, 30, 32, 32, 35, 35, 35, 35, 38, 38, 38, 38, 41, 43, 43, 43, 43, 48, 48, 48, 48, 51, 51, 51, 51, 54, 56, 56, 56, 56, 59, 59, 63, 63, 63, 63, 66, 66, 66, 66, 69, 71, 71, 71, 71, 74, 74, 74, 78, 80
OFFSET
0,5
LINKS
FORMULA
a(n) = n - A053610(n).
As a recurrence:
a(0) = 0; for n >= 1, a(n) = -1 + A048760(n) + a(n-A048760(n)). [Where A048760(n) gives the largest square <= n.]
Other identities. For all n >= 1:
a(n) = A255131(n) - A062535(n).
PROG
(Scheme, two variants)
(define (A260740 n) (- n (A053610 n)))
(definec (A260740 n) (if (zero? n) n (+ -1 (A048760 n) (A260740 (- n (A048760 n))))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 12 2015
STATUS
approved