A120614 a(n) = g(n+1) - g(n) where g(k) = floor(phi*floor(k/phi)) and phi = (1+sqrt(5))/2.
1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 1, 0, 2, 0
Offset: 1
Keywords
Links
- Muniru A Asiru, Table of n, a(n) for n = 1..1000
- F. Michel Dekking, Morphisms, Symbolic Sequences, and Their Standard Forms, Journal of Integer Sequences, Vol. 19 (2016), Article 16.1.1.
- M. Lothaire, Algebraic Combinatorics on Words, Cambridge, 2002.
Programs
-
Magma
[Floor((1+Sqrt(5))*Floor(2*(k+1)/(1+Sqrt(5)))/2) - Floor((1+Sqrt(5))*Floor(2*k/(1+Sqrt(5)))/2): k in [1..100]]; // G. C. Greubel, Oct 23 2018
-
Maple
g:=k->floor((1+sqrt(5))/2*floor(k/((1+sqrt(5))/2))): seq(g(n+1)-g(n),n=1..110); # Muniru A Asiru, Oct 21 2018
-
Mathematica
#[[2]]-#[[1]]&/@Partition[Table[Floor[GoldenRatio*Floor[n/GoldenRatio]],{n,0,110}],2,1] (* Harvey P. Dale, Dec 14 2012 *)
-
PARI
{phi=(1+sqrt(5))/2; g(k)=floor(phi*floor(k/phi))}; vector(100, n, g(n+1)-g(n)) \\ G. C. Greubel, Oct 23 2018
-
Python
from math import isqrt def A120614(n): return ((m:=(n+1+isqrt(5*(n+1)**2)>>1)-n-1)+isqrt(5*m**2)>>1)-((k:=(n+isqrt(5*n**2)>>1)-n)+isqrt(5*k**2)>>1) # Chai Wah Wu, May 22 2025
Formula
a(floor(k*phi)+k+1)=0; a(floor(k*phi)+k+2)=2, if n is not in {floor(k*phi)+k+1}U{floor(k*phi)+k+2}_{k>=1} a(n)=1.
(a(n)) is a fixed point of the morphism 02-->10202 and 102-->10210202. [Corrected by Michel Dekking, Oct 29 2018]
Fixed point of the morphism 0->102, 1->102, 2->02. - Michel Dekking, Oct 21 2018
Extensions
Initial 0 removed from data by Michel Dekking, Oct 22 2018
Comments