OFFSET
1
COMMENTS
Any periodicity?
The answer is: no. The sequence (a(n)) is a non-periodic morphic sequence. As shown in A197878, the sequence of first differences of (floor(n*sqrt(8))) with offset 0 is the unique fixed point of the substitution 4->45555, 5->455555. This implies that we can get the parity sequence by defining the substitution 1->14343, 2->23434, 3->234343, 4->143434, giving a fixed point (b(n)) = 1,4,3,4,3,1,4,3,4,3,4,..., and then applying the letter-to-letter map pi: 1->0, 3->0, 2->1, 4->1. One obtains pi(b) = a. - Michel Dekking, Jan 24 2017
The term a(70) is the first term where this sequence differs from A187976. - Michel Dekking, Jan 24 2017
If the fractional part of sqrt(2)*n > 1/2 then a(n) = 1, otherwise a(n) = 0. It is possible to see from this that since 5/4 < sqrt(2) < 7/4, there are no more than two consecutive 0's or 1's (a similar feature is found in A272532 and conjectured in A272170). The sequence looks quasiperiodic and its Fourier spectrum seems to present a maximum component at a frequency which converges to about 0.828 of the maximum frequency. - Andres Cicuttin, Jul 09 2019
Suppose that r is a positive irrational number and k >= 2. Let F(n) = F(n,r,k) = floor(k*n*r) - k*floor(n*r) = k*<n*r> - <n*k*r>, an integer in {0,1,...,k-1}, where <> denotes fractional part. Although F(n)/n -> k the sequence F(n)-k*n appears to be unbounded. For r = sqrt(2) and k = 2, we have F(n) = a(n). Proof: a(n) = 2*<n*r> - <2*n*r>, so that a(n) = 1 if and only if <r*n> > 1/2. The proof follows as in the first sentence of A. Cicuttin's comment. - Clark Kimberling, Sep 08 2019
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = 2*<n*sqrt(2)> - <2*n*sqrt(2)>, where <> denotes fractional part. - Clark Kimberling, Sep 08 2019
MATHEMATICA
Table[Mod[Floor[Sqrt[8]*n], 2], {n, 200}]
Table[Floor[2 n Sqrt[2]] - 2 Floor[n*Sqrt[2]], {n, 1, 200}] (* Clark Kimberling, Sep 09 2019 *)
PROG
(PARI) a(n)=sqrtint(8*n^2)%2 \\ Charles R Greathouse IV, Oct 25 2011
(Magma) [Floor(Sqrt(8*n^2)) mod (2): n in [1..100]]; // Vincenzo Librandi, Jul 14 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Oct 18 2011
STATUS
approved