OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Benoit Cloitre, Fractal walk starting at (0,0) with step of unit length turning right if a(n)=0 and left otherwise for n=1 up to 10^6
Sela Fried, The beauty of Beatty sequences.
FORMULA
a(n) = floor(n*sqrt(2)) mod 2. - T. D. Noe, Oct 11 2006
MATHEMATICA
Table[Floor[Sqrt[2]n]-2Floor[n/Sqrt[2]], {n, 120}] (* Harvey P. Dale, Mar 08 2017 *)
Table[Mod[Floor[Sqrt[2] n], 2], {n, 120}] (* IWABUCHI Yu(u)ki, May 01 2020 *)
PROG
(PARI) a(n)=sqrtint(2*n^2)%2 \\ Charles R Greathouse IV, Oct 14 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Benoit Cloitre, Apr 17 2003
STATUS
approved