login
A083035
a(n) = floor(sqrt(2)*n)-2*floor(n/sqrt(2)).
14
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,1
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
Cf. A083036, A083037, A083038, A001951 (floor(n*sqrt(2))).
Sequence in context: A372574 A028863 A089012 * A359422 A356161 A187074
KEYWORD
nonn,easy
AUTHOR
Benoit Cloitre, Apr 17 2003
STATUS
approved