A085002 a(n) = floor(phi*n) - 2*floor(phi*n/2) where phi is the golden ratio.
1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1
Offset: 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10946
- B. Cloitre, Graph of A085005(n) for n=1 up to 3874 [archive.org link]
- Benoit Cloitre, Fractal walk starting at (0,0) with step of unit length turning 90° right if a(n)=0 left otherwise for n=1 up to 10^6
- Michel Dekking, Iteration of maps by an automaton, Discrete Mathematics 126 (1994), 81-86.
- M. Schaefer, E. Sedgwick, and D. Štefankovič, Spiraling and folding: the word view, Algorithmica 60 (2011), 609-626. See section 4.
Crossrefs
Programs
-
Mathematica
Table[Floor[GoldenRatio n] - 2 Floor[GoldenRatio n/2], {n, 110}] (* Harvey P. Dale, Dec 11 2012 *)
-
PARI
a(n)=(n+sqrtint(5*n^2))%4>1 \\ Charles R Greathouse IV, Feb 07 2013
-
Python
from math import isqrt def A085002(n): return ((n+isqrt(5*n**2))&2)>>1 # Chai Wah Wu, Aug 10 2022
-
Scheme
(define (A085002 n) (A000035 (A105774 n))) ;; Antti Karttunen, Mar 17 2017
Formula
From Michel Dekking, Apr 24 2018: (Start)
Proof that this sequence is the parity sequence of the lower Wythoff sequence:
if n*phi/2 = M + e, with 0 < e < 1, then 2*floor(phi*n/2) = 2M, and
floor(phi*n) = floor(2M+2e) = 2M or 2M+1.
So floor(phi*n) - 2*floor(phi*n/2) = 0 if floor(phi*n) is even, and equals 1 if floor(phi*n) is odd. (End)
Comments