login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A023969 a(n) = round(sqrt(n)) - floor(sqrt(n)). 3
0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
First bit in fractional part of binary expansion of square root of n.
LINKS
FORMULA
Runs are 0^1, 0^2 1, 0^3 1^2, 0^4 1^3, ...
a(n) = 1 iff n >= 3 and n is in the interval [k*(k+1) + 1, ..., k*(k+1) + k] for some k >= 1.
a(n) = floor(2*sqrt(n)) - 2*floor(sqrt(n)). - Mircea Merca, Jan 31 2012
a(n) = A000194(n) - A000196(n) = floor(sqrt(n) + 1/2) - floor(sqrt(n)). - Ridouane Oudra, Jun 20 2019
MAPLE
seq(floor(2*sqrt(n))-2*floor(sqrt(n)), n=0..100); # Ridouane Oudra, Jun 20 2019
MATHEMATICA
Array[ Function[ n, RealDigits[ N[ Power[ n, 1/2 ], 10 ], 2 ]// (#[ [ 1, #[ [ 2 ] ]+1 ] ])& ], 110 ]
Table[Round[Sqrt[n]]-Floor[Sqrt[n]], {n, 0, 120}] (* Harvey P. Dale, Jan 02 2018 *)
PROG
(PARI) a(n)=sqrtint(4*n)-2*sqrtint(n) \\ Charles R Greathouse IV, Jan 31 2012
(Python)
from gmpy2 import isqrt_rem
def A023969(n):
i, j = isqrt_rem(n)
return int(4*(j-i) >= 1) # Chai Wah Wu, Aug 16 2016
CROSSREFS
Sequence in context: A355453 A336356 A319988 * A060039 A319710 A345951
KEYWORD
nonn
AUTHOR
EXTENSIONS
Revised by N. J. A. Sloane, Mar 20 2003
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 15:20 EDT 2024. Contains 371916 sequences. (Running on oeis4.)