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.

A056847 Nearest integer to n - sqrt(n).

This page as a plain text file.
%I A056847 #32 Jun 06 2025 03:29:14
%S A056847 0,0,1,1,2,3,4,4,5,6,7,8,9,9,10,11,12,13,14,15,16,16,17,18,19,20,21,
%T A056847 22,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,36,37,38,39,40,41,42,
%U A056847 43,44,45,46,47,48,49,49,50,51,52,53,54,55,56,57,58,59
%N A056847 Nearest integer to n - sqrt(n).
%D A056847 B. Alspach, K. Heinrich and G. Liu, Orthogonal factorizations of graphs, pp. 13-40 of Contemporary Design Theory, ed. J. H. Dinizt and D. R. Stinson, Wiley, 1992 (see Theorem 2.7).
%H A056847 Robert Israel, <a href="/A056847/b056847.txt">Table of n, a(n) for n = 0..10000</a>
%F A056847 From _Robert Israel_, Jun 13 2018: (Start)
%F A056847 a(n) = n-k for k^2-k+1 <= n <= k^2+k, k >= 1.
%F A056847 G.f.: x/(1-x)^2 - Theta_2(0,x)*x^(3/4)/(2*(1-x)) where Theta_2 is a Jacobi theta function. (End)
%F A056847 a(n) = n - floor(sqrt(n) + 1/2) = n - A000194(n). - _Ridouane Oudra_, May 13 2019
%p A056847 0,seq(seq(n-k, n=k^2-k+1..k^2+k),k=1..10); # _Robert Israel_, Jun 13 2018
%t A056847 Table[Round[n-Sqrt[n]],{n,0,70}] (* _Harvey P. Dale_, Jun 15 2014 *)
%o A056847 (Magma) [n-Floor(Sqrt(n)+1/2):n in [0..80]]; // _Marius A. Burtea_, May 13 2019
%o A056847 (PARI) a(n) = round(n - sqrt(n)); \\ _Michel Marcus_, May 13 2019
%o A056847 (Python)
%o A056847 from math import isqrt
%o A056847 def A056847(n): return n-(m:=isqrt(n))-int(n>m*(m+1)) # _Chai Wah Wu_, Jun 05 2025
%Y A056847 Cf. A000194, A028391.
%K A056847 nonn
%O A056847 0,5
%A A056847 _N. J. A. Sloane_, Dec 07 2000