cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 13 results. Next

A003623 Wythoff AB-numbers: floor(floor(n*phi^2)*phi), where phi = (1+sqrt(5))/2.

Original entry on oeis.org

3, 8, 11, 16, 21, 24, 29, 32, 37, 42, 45, 50, 55, 58, 63, 66, 71, 76, 79, 84, 87, 92, 97, 100, 105, 110, 113, 118, 121, 126, 131, 134, 139, 144, 147, 152, 155, 160, 165, 168, 173, 176, 181, 186, 189, 194, 199, 202, 207, 210, 215, 220, 223, 228, 231, 236, 241, 244, 249
Offset: 1

Views

Author

Keywords

Comments

Previous name was: "From a 3-way splitting of positive integers: [[n*phi^2]*phi]."
Union of A001950 & A003622 & A003623 = A000027.
a(n) is odd if and only if n is odd. - Clark Kimberling, Apr 21 2011
A005614(a(n)-1)=1 and A005614(a(n))=1, n>=1. Because Wythoff AB-numbers (see the formula section) mark the first entry of pairs of 1s in the rabbit sequence A005614(n-1), n>=1. - Wolfdieter Lang, Jun 28 2011
a(n) = k if and only if A270788(k) = 3, where A270788 is the infinite Fibonacci word on {1,2,3}. - Michel Dekking, Sep 07 2016
The asymptotic density of this sequence is 1/phi^3 = phi^3 - 4 = A098317 - 4 = 0.236067... . - Amiram Eldar, Mar 24 2025

References

  • Joe Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 10.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Let A = A000201, B = A001950. Then AA = A003622, AB = A003623, BA = A035336, BB = A101864.

Programs

  • Maple
    A003623:=proc(n) return floor(floor(n*(3+sqrt(5))/2)*(1+sqrt(5))/2); end:seq(A003623(n),n=1..59); # Nathaniel Johnston, Apr 21 2011
  • Mathematica
    f[n_] := Floor[ GoldenRatio * Floor[ n * GoldenRatio^2]]; Array[f, 47]
    (* another *) Table[n+2Floor[n*GoldenRatio],{n,1,100}]
  • PARI
    a(n)=(n+sqrtint(5*n^2))\2*2+n \\ Charles R Greathouse IV, Jan 25 2022
  • Python
    from sympy import floor
    from mpmath import phi
    def a(n): return floor(n*phi) + floor(n*phi**2) # Indranil Ghosh, Jun 10 2017
    
  • Python
    from math import isqrt
    def A003623(n): return (n+isqrt(5*n**2)&-2)+n # Chai Wah Wu, Aug 25 2022
    

Formula

a(n) = floor(n*phi) + floor(n*phi^2) = A000201(n) + A001950(n).
a(n) = 2*floor(n*phi) + n = 2*A000201(n) + n.
a(n) = A(B(n)) with A(k):=A000201(k) and B(k):=A001950(k), k>=1 (Wythoff AB-numbers).

Extensions

Name improved by Michel Dekking, Sep 07 2016

A019444 a_1, a_2, ..., is a permutation of the positive integers such that the average of each initial segment is an integer, using the greedy algorithm to define a_n.

Original entry on oeis.org

1, 3, 2, 6, 8, 4, 11, 5, 14, 16, 7, 19, 21, 9, 24, 10, 27, 29, 12, 32, 13, 35, 37, 15, 40, 42, 17, 45, 18, 48, 50, 20, 53, 55, 22, 58, 23, 61, 63, 25, 66, 26, 69, 71, 28, 74, 76, 30, 79, 31, 82, 84, 33, 87, 34, 90, 92, 36, 95, 97, 38, 100, 39, 103, 105, 41, 108, 110, 43, 113
Offset: 1

Views

Author

R. K. Guy and Tom Halverson (halverson(AT)macalester.edu)

Keywords

Comments

Self-inverse when considered as a permutation or function, i.e., a(a(n)) = n. - Howard A. Landman, Sep 25 2001
That each initial segment has an integer average is trivially equivalent to the sum of the first n elements always being divisible by n. - Franklin T. Adams-Watters, Jul 07 2014
Also, a lexicographically minimal sequence of distinct positive integers such that all values of a(n)-n are also distinct. - Ivan Neretin, Apr 18 2015
Comments from N. J. A. Sloane, Mar 29 2025 (Start):
Let d(n) = number of 1 <= i <= n such that a(i) < i. The d(i) sequence begins 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, ..., and appears to be A060144 without its initial term.
Let r(n) = 1 if a(n) < a(n+1), otherwise 0, and let f(n) = 1 if a(n) > a(n+1), otherwise 0. Then R = partial sums of r(n) and F = partial sums of f(n) count the rises and falls, respectively, in the present sequence. It appears that R and F are essentially A060143 and A060144 (again).
If a(n) is the k-th term in a monotonically strictly increasing rum of terms, set R(n) = k. It appears that the sequence R(n), n>=1, is essentially A270788.
For other sequences derived from the present one, see A382162, A382168, and A382169.
(End)

References

  • Muharem Avdispahić and Faruk Zejnulahi, An integer sequence with a divisibility property, Fibonacci Quarterly, Vol. 58:4 (2020), 321-333.

Crossrefs

Programs

  • Mathematica
    a[1]=1; a[n_] := a[n]=Module[{s, v}, s=a/@Range[n-1]; For[v=Mod[ -Plus@@s, n], v<1||MemberQ[s, v], v+=n, Null]; v]
    lst = {1}; f[s_List] := Block[{k = 1, len = 1 + Length@ lst, t = Plus @@ lst}, While[ MemberQ[s, k] || Mod[k + t, len] != 0, k++ ]; AppendTo[lst, k]]; Nest[f, lst, 69] (* Robert G. Wilson v, May 17 2010 *)
    Fold[Append[#1, #2 Ceiling[#2/GoldenRatio] - Total[#1]] &, {1}, Range[2, 70]] (* Birkas Gyorgy, May 25 2012 *)
  • PARI
    al(n)=local(v,s,fnd);v=vector(n);v[1]=s=1;for(k=2,n,fnd=0;for(i=1,k-1,if(v[i]==s,fnd=1;break));v[k]=if(fnd,s+k,s);s+=fnd);v \\ Franklin T. Adams-Watters, May 20 2010
    
  • PARI
    A019444_upto(N, c=0, A=Vec(1, N))={for(n=2, N, A[n]||(#AM. F. Hasler, Nov 27 2019

Formula

a(n) = A002251(n-1) + 1. (Corrected by M. F. Hasler, Sep 17 2014)
Let s(n) = (1/n)*Sum_{k=1..n} a(k) = A019446(n). Then if s(n-1) does not occur in a(1),...,a(n-1), a(n) = s(n) = s(n-1); otherwise, a(n) = s(n-1) + n and s(n) = s(n-1) + 1. - Franklin T. Adams-Watters, May 20 2010
Lim_{n->infinity} max(n,a(n))/min(n,a(n)) = phi = A001622. - Stanislav Sykora, Jun 12 2017

A123740 Characteristic sequence for Wythoff AB-numbers A003623.

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1
Offset: 1

Views

Author

Wolfdieter Lang, Oct 13 2006

Keywords

Comments

Left shifted sequence is the characteristic function of A035336, and also the second lowest digit of the Zeckendorf expansion of n. - Franklin T. Adams-Watters, Jun 30 2009
a(n) = A188009(n+2), n>=1. - Wolfdieter Lang, Jun 27 2011
Doubling the 0’s in the infinite Fibonacci word A003849 gives (a(n)). - Michel Dekking, Sep 09 2016
This is a morphic sequence, i.e., the letter-to-letter image of the fixed point of a morphism. The fixed point is the unique fixed point A270788 of the three symbol Fibonacci morphism. The letter-to-letter map is 1->0, 2->0, 3->1. - Michel Dekking, May 02 2019

References

Crossrefs

Programs

Formula

a(n) = 1 if n=A(B(k)) for some k>=1, else 0, with A(k):=A000201(k) and B(k):=A001950(k), k>=1.
a(n) = 1-(1-h(n))-(1-h(n+1)) = h(n)-(1-h(n+1))= h(n)*h(n+1) with h(n):=A005614(n-1), n>=1, the rabbit sequence.
a(n) = A(n+2)-A(n)-3. - Wolfdieter Lang, Jun 27 2011

A089910 Indices n at which blocks (1;1) occur in infinite Fibonacci word, i.e., such that A005614(n-1) = A005614(n-2) = 1.

Original entry on oeis.org

4, 9, 12, 17, 22, 25, 30, 33, 38, 43, 46, 51, 56, 59, 64, 67, 72, 77, 80, 85, 88, 93, 98, 101, 106, 111, 114, 119, 122, 127, 132, 135, 140, 145, 148, 153, 156, 161, 166, 169, 174, 177, 182, 187, 190, 195, 200, 203, 208, 211, 216, 221, 224, 229, 232, 237, 242, 245
Offset: 1

Views

Author

Benoit Cloitre, Nov 15 2003

Keywords

Comments

a(n) is the number k such that floor(k/r) = floor(n*r^2), where r = golden ratio. - Clark Kimberling, May 03 2015

Crossrefs

Programs

  • Maple
    phi:=(1+sqrt(5))/2:  seq(floor(phi*floor(n*phi^2))+1, n=1..80); # Michel Dekking, Sep 15 2016
  • Mathematica
    r = GoldenRatio; u = Flatten[Table[Select[Range[Floor[(r^2 + r) n], Floor[(r^2 + r) n + 1]], Floor[#/r] == Floor[n*r^2] &], {n, 1, 100}]] (* Clark Kimberling, May 03 2015 *)
  • Python
    from math import isqrt
    def A089910(n): return (n+isqrt(5*n**2)&-2)+n+1 # Chai Wah Wu, Aug 29 2022

Formula

a(n) = floor((2+sqrt(5))*n) + 0 or 1;
floor(n*(2+sqrt(5))) + b(a(n)) - a(n) = 0 where b(x) = A078588(x) = x + 1 + ceiling(x*sqrt(5)) - 2*ceiling(x*(1+sqrt(5))/2).
For n >= 2, a(n) = a(n-1) + d, where d = 5 if n-1 is in A000201, else d = 3. - Clark Kimberling, May 03 2015
a(n) = A003623(n) + 1 = A(B(n)) + 1, where A(B(n)) are the Wythoff AB-numbers. - Michel Dekking, Sep 15 2016

Extensions

Definition corrected by Jeffrey Shallit, Dec 21 2023

A294180 The 3-symbol Pell word.

Original entry on oeis.org

1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 1, 2
Offset: 1

Views

Author

Michel Dekking, Feb 11 2018

Keywords

Comments

In the Pell word A171588 = 0, 0, 1, 0, 0, 1, 0, 0, 0, ..., group the letters in overlapping blocks of length two: [0,0],[0,1],[1,0],[0,0],[0,1],[1,0],... Then code [0,0]->1, [0,1]->2, [1,0]->3. This gives (a(n)).
(a(n)) is the unique fixed point of the 3-symbol Pell morphism
1 -> 123, 2 ->123, 3 -> 1.
The morphism and the fixed point are in standard form.
Modulo a change of alphabet (1->0, 2->1, 3->2), this sequence is equal to A263844.
From Michel Dekking, Feb 23 2018: (Start)
The positions of 1 in (a(n)) are given by
A188376 = 1,4,7,8,11,14,15,18,...
Why is this true? First, the Pell word b is given by
b(n) = [(n+1)(1-r)]-[n(1-r)], where r =1/sqrt(2).
This can rewritten as
b(n) = [nr]-[(n+1)r]+1.
Second,
1 occurs at n in (a(n)) <=>
00 occurs at n in (b(n)) <=>
b(n)+b(n+1) = 0 <=>
[nr]-[(n+2)r]+2 = 0 <=>
[(n+2)r]-[nr]-1 = 1 <=>
1 occurs at n in A188374.
The positions of 2 in (a(n)) are given by A001952 - 1 = 2,5,9,12,16,..., since 2 occurs at n in (a(n)) if and only if 3 occurs at n+1 in (a(n)).
The positions of 3 in (a(n)) are given by A001952 = 3,6,10,13,17,..., since 3 occurs at n in (a(n)) if and only if 1 occurs at n in (b(n)).
The sequence of positions of 3 in (a(n)) is equal to the sequence b in Carlitz et al. The sequence of positions of 1 in (a(n)) seems to be equal to the sequence ad' in Carlitz et al. (End)
See the comments of A188376 for a proof of the observation on the positions of 1 in (a(n)). - Michel Dekking, Feb 27 2018

Crossrefs

Programs

  • Magma
    [Floor((n+2)*r)+Floor((n+1)*r)-2*Floor(n*r)+1 where r is 1-1/Sqrt(2): n in [1..90]]; // Vincenzo Librandi, Feb 23 2018
  • Maple
    a:=[seq(floor((n+2)*(1-1/sqrt(2)))+floor((n+1)*(1-1/sqrt(2)))-2*floor(n*(1-1/sqrt(2)))+1, n=1..130)];
  • Mathematica
    With[{r = 1 - 1/Sqrt[2]}, Table[Inner[Times, Map[Floor[(n + #) r] &, Range[0, 2]], {-2, 1, 1}, Plus] + 1, {n, 108}]] (* Michael De Vlieger, Feb 15 2018 *)

Formula

a(n) = floor((n+2)r)+floor((n+1)r)-2*floor(nr)+1, where r = 1-1/sqrt(2).

A005713 Define strings S(0)=0, S(1)=11, S(n) = S(n-1)S(n-2); iterate.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1
Offset: 0

Views

Author

Keywords

Comments

a(A035336(n)) = 0. - Reinhard Zumkeller, Dec 30 2011
a(n) = 1 - A123740(n). This can be seen as follows. Define words T(0)=0, T(1)=1, T(n) = T(n-1)T(n-2). Then T(infinity) is the binary complement of the infinite Fibonacci word A003849. Obviously S(n) is the [1->11] transform of T(n). The claim now follows from the observation (see Comments of A123740) that doubling the 0's in the infinite Fibonacci word A003849 gives A123740. - Michel Dekking, Oct 21 2018
From Michel Dekking, Oct 22 2018: (Start)
Here is a proof of Cloitre's (corrected) formula
a(n) = abs(A014677(n+1)).
Since abs(-1) = abs(1) = 1, one has to prove that A014677(k)=0 if and only if there is an n such that AB(n) = k (using that a(n) = 1 - A123740(n)). Now A014677 is the sequences of first differences of A001468, and the 0's in A014677 occur if and only if there occurs a block 22 in A001468, which is given by
A001468(n) = floor((n+1)*phi) - floor(n*phi), n >= 0.
But then
A001468(n) = A014675(n-1), n > 0.
The sequence A014675 is fixed point of the morphism 1->2, 2->21, which is alphabet equivalent to the morphism 1->12, 2->1, the classical Fibonacci morphism in standard form. This implies that the 22 blocks in A001468 occur at position n+1 in if and only if 3 occurs in the fixed point A270788 of the 3-symbol Fibonacci morphism at k, which happens if and only if there is an n such that AB(n)=k (see Formula of A270788). (End)

Examples

			The infinite word is S(infinity) = 110111101101111011110110...
		

Crossrefs

Programs

  • Haskell
    a005713 n = a005713_list !! n
    a005713_list = 1 : 1 : concat (sibb [0] [1,1]) where
       sibb xs ys = zs : sibb ys zs where zs = xs ++ ys
    -- Reinhard Zumkeller, Dec 30 2011
  • Mathematica
    s[0] = {0}; s[1] = {1, 1}; s[n_] := s[n] = Join[s[n-1], s[n-2]]; s[10] (* Jean-François Alcover, May 15 2013 *)
    nxt[{a_,b_}]:={b,Join[a,b]}; Drop[Nest[nxt,{{0},{1,1}},10][[1]],3] (* Harvey P. Dale, Jan 31 2019 *)
  • PARI
    a(n,f1,f2)=local(f3); for(i=3,n,f3=concat(f2,f1); f1=f2; f2=f3); f2
    
  • PARI
    printp(a(10,[ 0 ],[ 1,1 ])) \\ Would give S(10). Sequence is S(infinity).
    

Formula

From Benoit Cloitre, Apr 21 2003: (Start)
For n > 1, a(n-1) = floor(phi*ceiling(n/phi)) - ceiling(phi*floor(n/phi)) where phi=(1+sqrt(5))/2.
For n >= 0, a(n) = abs(A014677(n+1)). (End)

Extensions

Corrected by Michael Somos

A120614 a(n) = g(n+1) - g(n) where g(k) = floor(phi*floor(k/phi)) and phi = (1+sqrt(5))/2.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Jun 17 2006

Keywords

Comments

From Michel Dekking, Oct 29 2018: (Start)
Here is a proof that (a(n)) is fixed point of the morphism 0->102, 1->102, 2->02.
Let alpha:=phi-1. Then alpha*phi = 1. So
g(k) = floor(phi*floor(k*alpha)).
Write k*alpha = floor(k*alpha) + {k*alpha}, i.e., {k*alpha} is the fractional part of k*alpha. Then
g(k) = floor(phi*(k*alpha-{k*alpha})) = k + floor(-phi*{k*alpha}).
Thus
a(n) = n+1 +floor(-phi*{(n+1)*alpha})-n -floor(-phi*{n*alpha}).
It follows that
a(n) = 1 - floor(phi*{(n+1)*alpha}) + floor(phi*{n*alpha}).
The difference -floor(phi*{(n+1)*alpha}) + floor(phi*{n*alpha}) is equal to -1, 0 or 1, since floor(phi*{n*alpha}) is equal to 0 or 1.
In fact, phi*{n*alpha} can only take values between 0 and 1.619, and floor(phi*{n*alpha}) = 0 if and only if
{n*alpha} < 1/phi = alpha.
This is the same (putting rho:=1-alpha) as requiring
{n*alpha+rho} < 1-alpha.
Via the rotation description of Sturmian sequences (see, e.g., Lothaire), one sees that this sequence is the inhomogeneous Sturmian sequence s(alpha, rho), but with offset 1, and with 0 and 1 exchanged. Since rho+alpha=1, it follows that s(alpha, rho) with offset 2 equals s(1-alpha, 1-alpha), the classical Fibonacci sequence xF:=A003849, fixed point of 0->01, 1->0. We have found that
a(n+1)=0 iff xF(n)=0, xF(n+1)=1,
a(n+1)=1 iff xF(n)=0, xF(n+1)=0,
a(n+1)=2 iff xF(n)=1, xF(n+1)=0.
This means that (a(n+1)) equals the 3-symbol Fibonacci sequence A270788 on the alphabet {0,2,1}. Then Proposition 5 in "Morphisms, Symbolic Sequences, and Their Standard Forms" yields that (a(n)) is fixed point of the morphism 0->102, 1->102, 2->02. (End)

Crossrefs

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

A263844 Constant term in expansion of n in Fraenkel's exotic ternary representation.

Original entry on oeis.org

0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 0, 1, 2
Offset: 1

Views

Author

N. J. A. Sloane, Nov 06 2015

Keywords

Comments

Let {p_i, i >= 0} = {1,3,7,17,41,99,...} denote the numerators of successive convergents to sqrt(2) (see A001333). Then any n >= 0 has a unique representation as n = Sum_{i >= 0} d_i*p_i, with 0 <= d_i <= 2, d_{i+1}=2 => d_i=0. Sequence gives a(n+1) = d_0.
From Michel Dekking, Feb 11 2018: (Start)
(a(n)) is the unique fixed point of the morphism alpha given by
alpha: 0 -> 012, 1 -> 012, 2 -> 0.
To see this, note first that the p_i satisfy p_{i+2}=2p_{i+1}+p_i for all i=1,2,... Then define a sequence of words by
w(0) = 0, w(1) = 012, w(i+2) = w(i+1)w(i+1)w(i).
The length of w(i) is equal to p_i. In the numeration system, the representation of n = p_i is d = 10..0, and the representation of n = 2p_i is d = 20..0. By unicity of the representation, the numbers n = p_i +m have the representation d = 1c, where c is the representation of m for m = 1,...,p_{i-1}. Similarly, because the digit 2 is required to be followed by the digit 0, the numbers n = 2p_i + m have the representation d =20c, where c is the representation of m for m = 1,...,p_{i-2}. It follows from this that the d_0 digits in the range 0 to p_{i+2} have to satisfy the equation w(i+2) = w(i+1)w(i+1)w(i). But alpha(0)=alpha(1)=w(1), and alpha(2)=w(0), which implies by induction that w(i) = alpha^i(0):
w(i+1) = w(i)w(i)w(i-1) = alpha^i(0) alpha^i(0) alpha^{i-1}(0) =
alpha^i(0) alpha^i(1)alpha^i(2) = alpha^i(012) = alpha^{i+1}(0).
(a(n)) is modulo a change of alphabet (0->1, 1->2, 2->3) equal to A294180, the standard form of (a(n)). This combined with the fact that the Pell word A171588 is a Sturmian word leads to the formula for (a(n)) below. (End)

Examples

			See the link to Table 2 of Fraenkel (2000).
		

Crossrefs

Programs

  • Magma
    [Floor((n+2)*(1-1/Sqrt(2)))+Floor((n+1)*(1-1/Sqrt(2)))- 2*Floor(n*(1-1/Sqrt(2))): n in [1..100]]; // Vincenzo Librandi, Feb 12 2018
  • Mathematica
    Table[Floor[(n + 2) (1 - 1/Sqrt[2])] + Floor[(n + 1) (1 - 1/Sqrt[2])] - 2 Floor[n (1 - 1/Sqrt[2])], {n, 100}] (* Vincenzo Librandi, Feb 12 2018 *)

Formula

a(n) = floor((n+2)r) + floor((n+1)r) - 2*floor(nr), where r = 1 - 1/sqrt(2). - Michel Dekking, Feb 11 2018

Extensions

More terms and new offset from Michel Dekking, Feb 11 2018

A014677 First differences of A001468.

Original entry on oeis.org

1, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1, 0, -1, 1, -1, 1, 0, -1, 1, 0, -1, 1, -1, 1
Offset: 0

Views

Author

N. J. A. Sloane, Nov 07 2001

Keywords

Comments

A001468 is an infinite Fibonacci word with strings of 2's of length A001468(n) delimited by 1's. - Paul D. Hanna, Dec 17 2004
c(n):=a(n-1), n >= 1, is -1 if n is a Wythoff B-number from A001950, it is 0 if n=A(B(m)+1) for some m >= 1, with A(k):=A000201(k) (Wythoff A-numbers) and it is +1 if n=A(A(m)+1)=B(m)+1 for some m >= 0, with B(0):=0. - Wolfdieter Lang, Oct 13 2006
This sequence is a symbolic sequence as discussed in the paper "Morphisms, Symbolic Sequences, and Their Standard Forms". It can be derived directly from the 2-block morphism induced by the morphism generating A001468. Since A001468 is the Fibonacci word A003849, but on the alphabet {2,1}, with an extra 1 in front, this 2-block morphism has 3-symbol Fibonacci as a fixed point: A270788. The 2-blocks in A001468 are 12, 21, and 22, yielding the differences a(n) = 1, a(n) = -1, and a(n) = 0. In 3-symbol Fibonacci these correspond to the letters 2, 1, and 3. Expressing this coding with pi given by pi(1)=-1, pi(2)=1, pi(3)=0, we obtain the formula below. Wolfdieter Lang's Wythoff description of (a(n)) follows from the corresponding Wythoff description in A270788. - Michel Dekking, Dec 30 2019

Crossrefs

Cf. A001468, A000045. Essentially equal to A270788.

Programs

  • Python
    from math import isqrt
    def A014677(n): return (n+isqrt(m:=5*(n+2)**2)>>1)-(n+1+isqrt(m-10*n-15)&-2)+(n+isqrt(m-20*n-20)>>1)+1 # Chai Wah Wu, Aug 25 2022

Formula

abs(a(n)) = floor(f*ceiling(n/f)) - ceiling(f*floor(n/f)) where f=phi=(1+sqrt(5))/2; for n > 1, abs(a(n)) = A005713(n-1). - Benoit Cloitre, Apr 21 2003
G.f. equals the continued fraction: A(x) = [0;1, 1/x, 1/x, 1/x^2, 1/x^3, 1/x^5, 1/x^8, ..., 1/x^Fibonacci(n), ...]. - Paul D. Hanna, Dec 17 2004
a(n) = b(n) - b(n-1) with b(n):=A005614(n), n >= 1.
a(n) = pi(A270788(n)), n >= 1, where pi is the letter-to-letter map pi(1)=-1, pi(2)=1, pi(3)=0. - Michel Dekking, Dec 30 2019

A138967 Infinite Fibonacci word on the alphabet {1,2,3,4}.

Original entry on oeis.org

1, 2, 3, 1, 4, 1, 2, 3, 1, 2, 3, 1, 4, 1, 2, 3, 1, 4, 1, 2, 3, 1, 2, 3, 1, 4, 1, 2, 3, 1, 2, 3, 1, 4, 1, 2, 3, 1, 4, 1, 2, 3, 1, 2, 3, 1, 4, 1, 2, 3, 1, 4, 1, 2, 3, 1, 2, 3, 1, 4, 1, 2, 3, 1, 2, 3, 1, 4, 1, 2, 3, 1, 4, 1, 2, 3, 1, 2, 3, 1, 4, 1, 2, 3, 1, 2, 3, 1, 4, 1, 2, 3, 1, 4, 1, 2, 3, 1, 2, 3, 1, 4, 1, 2, 3
Offset: 1

Views

Author

Clark Kimberling, Apr 04 2008

Keywords

Comments

Start with the infinite Fibonacci word A003849, which is 0100101001001010010... and replace each 0 by 1,2,3 and each 1 by 1,4.
(a(n)) is the unique fixed point of the morphism 1->12, 2->3, 3->14, 4->3, obtained by coding the overlapping 3-block morphism of the Fibonacci morphism according to 010<->1, 100<->2, 001<->3, 101<->4. - Michel Dekking, Sep 28 2017

Crossrefs

Formula

a(n) = 3 for n = 3, 8, 21, 55, ..., F(2*k), where k>1.
a(n) = 4 for n = 5, 13, 34, 89, ..., F(2*k+1), where k>1.
Let A(n)=floor(n*tau), B(n)=n+floor(n*tau); i.e., A and B are the lower and upper Wythoff sequences, A=A000201, B=A001950. a(n)=1 if n=A(A(k)) for some k; a(n)=2 if n=B(A(k)) for some k; a(n)=3 if n=A(B(k)) for some k; a(n)=4 if n=B(B(k)) for some k.
Showing 1-10 of 13 results. Next