login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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