cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A261224 a(n) = number of steps needed to reach (n^2)-1 when starting from k = ((n+1)^2)-1 and repeatedly applying the map that replaces k with k - A053610(k), where A053610(k) = the number of positive squares that sum to k using the greedy algorithm.

This page as a plain text file.
%I A261224 #16 Mar 30 2017 21:57:06
%S A261224 1,2,2,3,3,3,4,5,5,6,6,7,7,7,8,8,9,10,10,11,11,12,12,12,13,13,14,14,
%T A261224 15,15,16,17,17,18,18,19,19,19,20,21,21,21,22,22,23,23,24,24,25,26,26,
%U A261224 27,27,28,28,28,29,30,30,31,31,31,32,32,33,33,34,34,35,35,36,37,37,38,38,39,39,39,40,41,41,42,42,42,43,43,44,44,45,45,46
%N A261224 a(n) = number of steps needed to reach (n^2)-1 when starting from k = ((n+1)^2)-1 and repeatedly applying the map that replaces k with k - A053610(k), where A053610(k) = the number of positive squares that sum to k using the greedy algorithm.
%H A261224 Antti Karttunen, <a href="/A261224/b261224.txt">Table of n, a(n) for n = 1..6000</a>
%F A261224 a(n) = A261221(((n+1)^2)-1) - A261221((n^2)-1). [The definition.]
%F A261224 Equally, for all n >= 1:
%F A261224 a(n) = A261221((n+1)^2) - A261221(n^2).
%F A261224 a(n) = A261222(n+1) - A261222(n).
%F A261224 a(n) = A261223(n+1) - A261223(n).
%t A261224 Table[-1 + Length@ NestWhileList[# - Block[{m = #, c = 1}, While[a = (# - Floor[Sqrt@ #]^2) &@ m; a != 0, c++; m = a]; c] &, ((n + 1)^2) - 1, # != n^2 - 1 &], {n, 91}] (* _Michael De Vlieger_, Sep 08 2016, after _Jud McCranie_ at A053610 *)
%o A261224 (Scheme, three variants, the first one utilizing memoization-macro definec)
%o A261224 (definec (A261224 n) (let ((end (- (A000290 n) 1))) (let loop ((k (- (A000290 (+ 1 n)) 1)) (s 0)) (if (= k end) s (loop (A260740 k) (+ 1 s))))))
%o A261224 (define (A261224 n) (- (A261223 (+ 1 n)) (A261223 n)))
%o A261224 (define (A261224 n) (- (A261221 (A000290 (+ 1 n))) (A261221 (A000290 n))))
%Y A261224 First differences of both A261222 and A261223.
%Y A261224 Cf. A000290, A053610, A260740, A261221.
%Y A261224 Cf. also A260734, A261229.
%K A261224 nonn
%O A261224 1,2
%A A261224 _Antti Karttunen_, Aug 12 2015