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.
%I A276581 #7 Sep 08 2016 17:52:43 %S A276581 0,1,2,2,3,3,4,4,4,5,5,5,6,6,6,7,7,7,7,8,8,8,8,8,9,9,9,9,9,10,10,10, %T A276581 10,10,10,11,11,11,11,11,11,12,12,12,12,12,12,12,13,13,13,13,13,13,13, %U A276581 14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,18 %N A276581 After a(0)=0, each n occurs A261224(n) times. %C A276581 Auxiliary function for computing A276582 & A276583. %H A276581 Antti Karttunen, <a href="/A276581/b276581.txt">Table of n, a(n) for n = 0..9996</a> %t A276581 Table[Table[n, {-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, 0, 18}] // Flatten (* _Michael De Vlieger_, Sep 08 2016 *) %o A276581 (Scheme) (define (A276581 n) (let loop ((k 0)) (if (>= (A261223 (+ 1 k)) n) k (loop (+ 1 k))))) %Y A276581 Cf. A261223, A261224, A276582, A276583. %K A276581 nonn %O A276581 0,3 %A A276581 _Antti Karttunen_, Sep 07 2016