login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A038760 a(n) = n - floor(sqrt(n)) * ceiling(sqrt(n)). 5
0, 0, 0, 1, 0, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 3, 0, -3, -2, -1, 0, 1, 2, 3, 4, 0, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 0, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 0, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 0, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, -8, -7, -6, -5, -4 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,9

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..10000

FORMULA

a(n) = n - A000196(n)*A003059(n) = n - A038759(n).

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

CROSSREFS

Cf. A053188.

Sequence in context: A036580 A101674 A100820 * A245825 A143946 A226860

Adjacent sequences:  A038757 A038758 A038759 * A038761 A038762 A038763

KEYWORD

sign,easy

AUTHOR

Henry Bottomley, May 03 2000

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 17 10:37 EDT 2019. Contains 327129 sequences. (Running on oeis4.)