A083035 a(n) = floor(sqrt(2)*n)-2*floor(n/sqrt(2)).
1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0
Offset: 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.
Programs
-
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 *)
-
PARI
a(n)=sqrtint(2*n^2)%2 \\ Charles R Greathouse IV, Oct 14 2013
Formula
a(n) = floor(n*sqrt(2)) mod 2. - T. D. Noe, Oct 11 2006