login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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

Chai Wah Wu, Table of n, a(n) for n = 0..10000

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

Cf. A080343, A080344.

Sequence in context: A268340 A336356 A319988 * A060039 A319710 A107078

Adjacent sequences:  A023966 A023967 A023968 * A023970 A023971 A023972

KEYWORD

nonn

AUTHOR

N. J. A. Sloane, Olivier Gérard

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 27 03:21 EDT 2020. Contains 337380 sequences. (Running on oeis4.)