login
After a(0)=0, each n occurs A261224(n) times.
3

%I #7 Sep 08 2016 17:52:43

%S 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 10,10,10,11,11,11,11,11,11,12,12,12,12,12,12,12,13,13,13,13,13,13,13,

%U 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 After a(0)=0, each n occurs A261224(n) times.

%C Auxiliary function for computing A276582 & A276583.

%H Antti Karttunen, <a href="/A276581/b276581.txt">Table of n, a(n) for n = 0..9996</a>

%t 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 (Scheme) (define (A276581 n) (let loop ((k 0)) (if (>= (A261223 (+ 1 k)) n) k (loop (+ 1 k)))))

%Y Cf. A261223, A261224, A276582, A276583.

%K nonn

%O 0,3

%A _Antti Karttunen_, Sep 07 2016