# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/
Search: id:a053186
Showing 1-1 of 1
%I A053186 #42 Mar 12 2021 22:24:42
%S A053186 0,0,1,2,0,1,2,3,4,0,1,2,3,4,5,6,0,1,2,3,4,5,6,7,8,0,1,2,3,4,5,6,7,8,
%T A053186 9,10,0,1,2,3,4,5,6,7,8,9,10,11,12,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
%U A053186 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,0,1,2,3,4,5,6,7,8,9,10,11,12,13
%N A053186 Square excess of n: difference between n and largest square <= n.
%C A053186 From _David W. Wilson_, Jan 05 2009: (Start)
%C A053186 More generally we may consider sequences defined by:
%C A053186 a(n) = n^j - (largest k-th power <= n^j),
%C A053186 a(n) = n^j - (largest k-th power < n^j),
%C A053186 a(n) = (largest k-th power >= n^j) - n^j,
%C A053186 a(n) = (largest k-th power > n^j) - n^j,
%C A053186 for small values of j and k.
%C A053186 The present entry is the first of these with j = 1 and n = 2.
%C A053186 It might be interesting to add further examples to the OEIS. (End)
%C A053186 a(A000290(n)) = 0; a(A005563(n)) = 2*n. - _Reinhard Zumkeller_, May 20 2009
%C A053186 0 ^ a(n) = A010052(n). - _Reinhard Zumkeller_, Feb 12 2012
%C A053186 From _Frank M Jackson_, Sep 21 2017: (Start)
%C A053186 The square excess of n has a reference in the Bakhshali Manuscript of Indian mathematics elements of which are dated between AD 200 and 900. A section within describes how to estimate the approximate value of irrational square roots. It states that for n an integer with an irrational square root, let b^2 be the nearest perfect square < n and a (=a(n)) be the square excess of n, then
%C A053186 sqrt(n) = sqrt(b^2+a) ~ b + a/(2b) - (a/(2b))^2/(2(b+a/(2b))). (End)
%H A053186 Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
%H A053186 H. Bottomley, Illustration of A000196, A048760, A053186
%H A053186 J. J. O'Connor, E. F. Robertson.The Bakhshali manuscript, Historical Topics, St Andrews University.
%H A053186 Michael Somos, Sequences used for indexing triangular or square arrays
%H A053186 S. H. Weintraub, An interesting recursion, Amer. Math. Monthly, 111 (No. 6, 2004), 528-530.
%H A053186 Wikipedia, Bakhshali manuscript
%F A053186 a(n) = n - A048760(n) = n - floor(sqrt(n))^2.
%F A053186 a(n) = f(n,1) with f(n,m) = if n < m then n else f(n-m,m+2). - _Reinhard Zumkeller_, May 20 2009
%p A053186 A053186 := proc(n) n-(floor(sqrt(n)))^2 ; end proc;
%t A053186 f[n_] := n - (Floor@ Sqrt@ n)^2; Table[f@ n, {n, 0, 94}] (* _Robert G. Wilson v_, Jan 23 2009 *)
%o A053186 (PARI) A053186(n)= { if(n<0,0,n-sqrtint(n)^2) }
%o A053186 (Haskell)
%o A053186 a053186 n = n - a048760 n
%o A053186 a053186_list = f 0 0 (map fst $ iterate (\(y,z) -> (y+z,z+2)) (0,1))
%o A053186 where f e x ys'@(y:ys) | x < y = e : f (e + 1) (x + 1) ys'
%o A053186 | x == y = 0 : f 1 (x + 1) ys
%o A053186 -- _Reinhard Zumkeller_, Apr 27 2012
%Y A053186 Cf. A002262, A048760. A071797(n) = 1 + a(n-1).
%Y A053186 Cf. A002262. - _Reinhard Zumkeller_, May 20 2009
%Y A053186 Cf. A048760, A000196.
%K A053186 easy,nonn
%O A053186 0,4
%A A053186 _Henry Bottomley_, Mar 01 2000
# Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE