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.

A278586 Start with X = n^2. Repeatedly replace X with X - ceiling(X/n); a(n) is the number of steps to reach 0.

This page as a plain text file.
%I A278586 #57 Jul 09 2025 04:42:14
%S A278586 1,3,5,8,11,14,17,21,24,28,32,36,40,44,49,53,57,62,66,71,75,80,84,90,
%T A278586 94,99,103,109,113,118,123,128,133,139,143,149,154,159,164,170,175,
%U A278586 180,185,191,196,201,207,212,217,223,229,234,240,246,251,256,262,268,273,279,284,290,296,302,308
%N A278586 Start with X = n^2. Repeatedly replace X with X - ceiling(X/n); a(n) is the number of steps to reach 0.
%H A278586 Robert G. Wilson v, <a href="/A278586/b278586.txt">Table of n, a(n) for n = 1..1000</a>
%H A278586 Matthijs Coster, <a href="https://pyth.eu/uploads/user/ArchiefPDF/Pyth55-6.pdf">Een Eigen Rij - Uitslag Prijsvraag</a>, Pythagoras, Number 6, June 2016, pp. 20-21. The sequence was discovered by Pim Spelier.
%p A278586 A278586 := proc(n)
%p A278586     local x,a;
%p A278586     x := n^2 ;
%p A278586     a := 0 ;
%p A278586     while x <> 0 do
%p A278586         x:= x-ceil(x/n) ;
%p A278586         a := a+1 ;
%p A278586     end do:
%p A278586     a;
%p A278586 end proc: # _R. J. Mathar_, Dec 02 2016
%t A278586 f[n_] := Length@ NestWhileList[# - Ceiling[#/n] &, n^2, # > 1 &]; Array[f, 65] (* _Robert G. Wilson v_, Dec 01 2016 *)
%o A278586 (Magma) a:=[]; for n in [1..58] do k:=n^2; count:=0; while k gt 0 do count+:=1; k-:=Ceiling(k/n); end while; a[n]:=count; end for; a; // _Jon E. Schoenfield_, Dec 01 2016
%Y A278586 Cf. A052488.
%K A278586 nonn,easy
%O A278586 1,2
%A A278586 _N. J. A. Sloane_, Dec 02 2016, based on discussions about the Pythagoras article in the Sequence Fans Mailing List, Dec 01 2016. _Jack Brennen_ provided the definition given here