|
|
A053186
|
|
Square excess of n: difference between n and largest square <= n.
|
|
44
|
|
|
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, 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, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
More generally we may consider sequences defined by:
a(n) = n^j - (largest k-th power <= n^j),
a(n) = n^j - (largest k-th power < n^j),
a(n) = (largest k-th power >= n^j) - n^j,
a(n) = (largest k-th power > n^j) - n^j,
for small values of j and k.
The present entry is the first of these with j = 1 and n = 2.
It might be interesting to add further examples to the OEIS. (End)
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
sqrt(n) = sqrt(b^2+a) ~ b + a/(2b) - (a/(2b))^2/(2(b+a/(2b))). (End)
|
|
LINKS
|
|
|
FORMULA
|
a(n) = n - A048760(n) = n - floor(sqrt(n))^2.
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
|
|
MAPLE
|
A053186 := proc(n) n-(floor(sqrt(n)))^2 ; end proc;
|
|
MATHEMATICA
|
f[n_] := n - (Floor@ Sqrt@ n)^2; Table[f@ n, {n, 0, 94}] (* Robert G. Wilson v, Jan 23 2009 *)
|
|
PROG
|
(PARI) A053186(n)= { if(n<0, 0, n-sqrtint(n)^2) }
(Haskell)
a053186 n = n - a048760 n
a053186_list = f 0 0 (map fst $ iterate (\(y, z) -> (y+z, z+2)) (0, 1))
where f e x ys'@(y:ys) | x < y = e : f (e + 1) (x + 1) ys'
| x == y = 0 : f 1 (x + 1) ys
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|