Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A260733
a(n) = number of steps needed to reach zero when starting from k = (n^2)-1 and repeatedly applying the map that replaces k with k - A002828(k), where A002828(k) = the least number of squares that add up to k.
12
0, 1, 3, 5, 9, 13, 18, 23, 30, 37, 44, 52, 62, 71, 81, 91, 104, 117, 131, 144, 159, 174, 190, 207, 224, 243, 262, 281, 301, 321, 343, 365, 388, 412, 437, 461, 487, 514, 539, 567, 596, 625, 654, 684, 715, 748, 781, 814, 848, 883, 918, 955, 991, 1030, 1067, 1105, 1145, 1187, 1227, 1269, 1311, 1354, 1396, 1441, 1486, 1531, 1579, 1624, 1673, 1723, 1773, 1821
OFFSET
1,3
LINKS
FORMULA
a(n) = A260731((n^2)-1).
a(n) = A260732(n)-1.
MATHEMATICA
Table[Length[#] - 2 &@ NestWhileList[# - (If[First@ # > 0, 1, Length[ First@ Split@ #] + 1] &@ SquaresR[Range@ 4, #]) &, n^2, # != 0 &], {n, 72}] (* Michael De Vlieger, Sep 08 2016 *)
PROG
(Scheme, two variants, the other one utilizing memoization-macro definec)
(definec (A260733 n) (if (= 1 n) 0 (+ (A260734 (- n 1)) (A260733 (- n 1)))))
(define (A260733 n) (A260731 (- (* n n) 1)))
CROSSREFS
One less than A260732.
Cf. also A261223.
Sequence in context: A152737 A032635 A036713 * A265429 A356254 A122248
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 12 2015
STATUS
approved