OFFSET
0,9
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
EXAMPLE
Sqrt(31) is between 5 and 6, and 31 - 6*5 = 1, so a(31)=1.
MAPLE
a:= n-> n -(x-> floor(x)*ceil(x))(sqrt(n)):
seq(a(n), n=0..100); # Alois P. Heinz, Jan 03 2015
MATHEMATICA
f[n_]:=n-Floor[Sqrt[n]]*Ceiling[Sqrt[n]]; Table[f[n], {n, 0, 5!}] (* Vladimir Joseph Stephan Orlovsky, Mar 29 2010 *)
PROG
(PARI) a(n)=if(issquare(n), 0, my(s=sqrtint(n)); n-s^2-s) \\ Charles R Greathouse IV, Feb 07 2013
(Python)
from math import isqrt
def A038760(n): return m-k if (m:=n-(k:=isqrt(n))**2) else 0 # Chai Wah Wu, Jul 28 2022
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Henry Bottomley, May 03 2000
STATUS
approved