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.

A028391 a(n) = n - floor(sqrt(n)).

This page as a plain text file.
%I A028391 #56 Sep 04 2025 09:36:50
%S A028391 0,0,1,2,2,3,4,5,6,6,7,8,9,10,11,12,12,13,14,15,16,17,18,19,20,20,21,
%T A028391 22,23,24,25,26,27,28,29,30,30,31,32,33,34,35,36,37,38,39,40,41,42,42,
%U A028391 43,44,45,46,47,48,49,50,51,52,53,54,55,56,56,57,58,59,60,61,62,63,64,65
%N A028391 a(n) = n - floor(sqrt(n)).
%C A028391 Number of nonsquares <= n.
%C A028391 Number of k <= n with an even number of divisors. - _Benoit Cloitre_, Sep 07 2002
%C A028391 Construct the pyramid
%C A028391 ............a(0)
%C A028391 .......a(1).a(2).a(3)
%C A028391 ..a(4).a(5).a(6).a(7).a(8).. etc.
%C A028391 Now circle all the primes and the result will be a pattern very similar to the famous Ulam spiral. - _Sam Alexander_, Nov 14 2003
%C A028391 The sequence floor(n-n^(1/2)) gives the same numbers with a different offset. - _Mohammad K. Azarian_, _R. J. Mathar_ and _M. F. Hasler_, Apr 30 2008
%C A028391 The number of nonzero values of floor (j^2/n) taken over 1 <= j <= n-1.
%C A028391 a(n) = A173517(n) iff n is not a square. - _Reinhard Zumkeller_, Feb 20 2010
%C A028391 a(n) - a(n-1) = 0 if n is a square, otherwise 1. - _Robert Israel_, Dec 30 2014
%D A028391 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 A028391 Reinhard Zumkeller, <a href="/A028391/b028391.txt">Table of n, a(n) for n = 0..10000</a>
%H A028391 Thomas Bloom, <a href="https://www.erdosproblems.com/121">Problem 121</a>, Erdős Problems.
%H A028391 Dick Boland, <a href="https://web.archive.org/web/20040409184718/http://imathination.net/SSS_first.htm">Introduction to the Square Spine Spiral</a>, 2000-2003.
%H A028391 Terence Tao, <a href="https://github.com/teorth/erdosproblems/blob/main/README.md#table">Erdős problem database</a>, see no. 121.
%F A028391 a(n) = ceiling(n - sqrt(n)), as follows from ceiling(-x) = -floor(x). [Corrected by _M. F. Hasler_, Feb 21 2010]
%F A028391 a(n) = 2*n - A028392(n). - _Reinhard Zumkeller_, Oct 28 2012
%F A028391 G.f.: (1+x)/(2*(1-x)^2) - Theta3(0,x)/(2*(1-x)) where Theta3 is a Jacobi theta function. - _Robert Israel_, Dec 30 2014
%p A028391 seq(n - floor(sqrt(n)), n = 0 .. 100); # _Robert Israel_, Dec 30 2014
%t A028391 f[n_]:=n-Floor[Sqrt[n]];Table[f[n],{n,0,5!}] (* _Vladimir Joseph Stephan Orlovsky_, Mar 29 2010 *)
%o A028391 (Haskell)
%o A028391 a028391 n = n - a000196 n  -- _Reinhard Zumkeller_, Oct 28 2012
%o A028391 (PARI) a(n)=n-sqrtint(n) \\ _Charles R Greathouse IV_, Jun 28 2013
%o A028391 (Magma) [n-Floor(Sqrt(n)): n in [0..100]]; // _Vincenzo Librandi_ Dec 31 2014
%o A028391 (Python)
%o A028391 from math import isqrt
%o A028391 def A028391(n): return n-isqrt(n) # _Chai Wah Wu_, Jul 28 2022
%Y A028391 Cf. A056847, A000196, A135662-A135665, A166373.
%K A028391 nonn,easy,nice,changed
%O A028391 0,4
%A A028391 John Mellor (u15630(AT)snet.net)
%E A028391 Edited by _N. J. A. Sloane_ at the suggestion of _R. J. Mathar_, May 01 2008
%E A028391 Comment and cross-reference added by _Christopher Hunt Gribble_, Oct 13 2009
%E A028391 Formula corrected by _M. F. Hasler_, Feb 21 2010
%E A028391 More terms from _Vladimir Joseph Stephan Orlovsky_, Mar 29 2010