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-3 of 3 results.

A284620 {00->2}-transform of the infinite Fibonacci word A003849.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 02 2017

Keywords

Comments

From Michel Dekking, Mar 17 2020: (Start)
This sequence is a morphic sequence, i.e., the letter-to-letter image of the fixed point of a morphism mu. In fact, one can take the alphabet {A,B,C,D} with the morphism
mu: A->AB, B->CD, C->ABCD, D->CD,
and the letter-to-letter map lambda defined by
lambda: A->0, B->1, C->2, D->1.
Then (a(n)) = lambda(x), where x = ABCDABCDCD... is the unique fixed point of the morphism mu.
How does one see this? The infinite Fibonacci word
x_F = A003849 = 0100101001001....
can be written as a concatenation of the two words 01 and 001.
In fact, if beta is the Fibonacci morphism 0->01, 1->0, then beta(01)=010, beta(001)=01010, from which this can be read off.
This can also be found in Lemma 23 in Allouche and Dekking, which gives, moreover, that if we define the morphism g on the alphabet {a,b} by
g(a) = ab, g(b) =abb
then a(n) = delta(x_G(n)), where
x_G = ababbababb...
is the unique fixed point of g, and delta is the map
delta(a) = 01, delta(b) = 21.
In my paper "Morphic words,..." such a map delta is called a decoration.
It is well-known that decorated fixed points are morphic sequences, and the 'natural' algorithm to achieve this splits a in AB, and b in CD. This gives the morphism mu on the alphabet {A,B,C,D}, and the letter-to-letter map lambda.
We next prove the first conjecture by Kimberling. We easily see from the form of mu that the letters B and D occur, and only occur, at even positions in the fixed point x of mu. Since lambda(B)=lambda(D)=1, and A and C are not mapped to 1, it follows immediately that the positions of 1 in (a(n)) are given by A005843 = (2n).
For a proof of Kimberling's second conjecture, note that a(n)=2 iff x(n)=C, where x is the fixed point of mu. The return words of C in x are CD and CDAB. Coding these two return words by their lengths, mu induces a descendant morphism tau given by
tau(2) = 24, tau(4) = 244.
We see that tau is just an alphabet change of the morphism g. Let t = 2424424244... be the unique fixed point of tau. It is well-known (see, e.g., Lemma 12 in "Morphic words,..."), that t = 2 x_F, where x_F = x_F(4,2) now is the Fibonacci word on the alphabet {4,2}. The partial sums of x_F(4,2) are equal to the generalized Beatty sequence V given by
V(n) = 2*floor(n*phi) + 1,
according to Lemma 8 in the Allouche and Dekking paper.
This proves Kimberling's conjecture, provided we give the sequence A130568 offset 1, as we should.
(End)

Examples

			As a word, A003849 = 01001010010010100..., and replacing each 00 by 2 gives 012101212101210...
		

Crossrefs

Programs

  • Mathematica
    s = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {0}}] &, {0}, 13]  (* A003849 *)
    w = StringJoin[Map[ToString, s]]
    w1 = StringReplace[w, {"00" -> "2"}]
    st = ToCharacterCode[w1] - 48 (* A284620 *)
    Flatten[Position[st, 0]]  (* A284621 *)
    Flatten[Position[st, 1]]  (* A005843 - conjectured *)
    Flatten[Position[st, 2]]  (* A130568 - conjectured *)
  • Python
    from math import isqrt
    def A130568(n): return (n+isqrt(5*n**2)&-2)|1
    def A284620(n):
        def bsearch(f, n):
            kmin, kmax = 0, 1
            while f(kmax) <= n:
                kmax <<= 1
            kmin = kmax>>1
            while True:
                kmid = kmax+kmin>>1
                if f(kmid) > n:
                    kmax = kmid
                else:
                    kmin = kmid
                if kmax-kmin <= 1:
                    break
            return kmin
        return (2 if n>1 and A130568(bsearch(A130568,n))==n else 0) if n&1 else 1 # Chai Wah Wu, May 22 2025

A284621 Positions of 0 in A284620.

Original entry on oeis.org

1, 5, 11, 15, 21, 27, 31, 37, 41, 47, 53, 57, 63, 69, 73, 79, 83, 89, 95, 99, 105, 109, 115, 121, 125, 131, 137, 141, 147, 151, 157, 163, 167, 173, 179, 183, 189, 193, 199, 205, 209, 215, 219, 225, 231, 235, 241, 247, 251, 257, 261, 267, 273, 277, 283, 287
Offset: 1

Views

Author

Clark Kimberling, May 02 2017

Keywords

Comments

This sequence and A005843 and A130568 partition the positive integers into sequences with slopes t = 1+sqrt(5), u = 3+sqrt(5), v = 2, where 1/t + 1/u + 1/v = 1. The positions of 1 in A284620 are given by A005843, and of 2, by A130568.
From Michel Dekking, Mar 17 2020: (Start)
This sequence is a generalized Beatty sequence.
It was shown in the Comments of A284620 that A284620 is the letter-to-letter image of the fixed point x = ABCDABCDCD... of the morphism
mu: A->AB, B->CD, C->ABCD, D->CD,
with the letter-to-letter map lambda defined by
lambda: A->0, B->1, C->2, D->1.
Note that A284620(n)=0 iff x(n) = A, where x = ABCDABCDCD... is the fixed point of mu. The return words of A in x are ABCD and ABCDCD. Coding these two return words by their lengths, mu induces a morphism rho on the coded return words given by
rho(4) = 46, rho(4) = 466.
The difference sequence (a(n+1)-a(n)) equals the unique fixed point r = 4646646466... of rho.
The morphism g on the alphabet {a,b} given by
g(a) = ab, g(b) =abb
was introduced in A284620. We see that rho is just an alphabet change of the morphism g.
Let f given by f(b) = ba, f(a) = b be the Fibonacci morphism on the alphabet {b,a} with fixed point x_F = babbababba....
Let x_G = ababbababb... be the fixed point of g. It is well-known (see, e.g., Lemma 12 in "Morphic words..."), that x_G = a x_F.
In general the partial sums of x_F are equal to the generalized Beatty sequence V given by V(n) = p*floor(n*phi) +q*n+r, where p = a-b and q = 2*b-a. See Lemma 8 in the Allouche and Dekking paper. Here we obtain p = 2, q = 2. So a(n) = 2*floor((n-1)*phi) + 2*n - 1, for n>0.
(End)

Examples

			As a word, A284620 = 012101212101210121..., in which 0 is in positions 1,5,11,15,...
		

Crossrefs

Programs

  • Mathematica
    s = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {0}}] &, {0}, 13]  (* A003849 *)
    w = StringJoin[Map[ToString, s]]
    w1 = StringReplace[w, {"00" -> "2"}]
    st = ToCharacterCode[w1] - 48 (* A284620 *)
    Flatten[Position[st, 0]]  (* A284621 *)
    Flatten[Position[st, 1]]  (* A005843 *)
    Flatten[Position[st, 2]]  (* A130568 *)
  • Python
    from math import isqrt
    def A284621(n): return (n-1+isqrt(5*(n-1)**2)&-2)+(n<<1)-1 # Chai Wah Wu, May 22 2025

Formula

a(n+1) = 2*A001950(n) + 1, n>0. - Michel Dekking, Mar 17 2020

A132222 Beatty sequence 1+2*floor(n*Pi/2), which contains infinitely many primes.

Original entry on oeis.org

1, 3, 7, 9, 13, 15, 19, 21, 25, 29, 31, 35, 37, 41, 43, 47, 51, 53, 57, 59, 63, 65, 69, 73, 75, 79, 81, 85, 87, 91, 95, 97, 101, 103, 107, 109, 113, 117, 119, 123, 125, 129, 131, 135, 139, 141, 145, 147, 151, 153, 157, 161, 163, 167, 169, 173, 175, 179, 183, 185, 189
Offset: 0

Views

Author

Jonathan Vos Post, Aug 14 2007

Keywords

Comments

The primes in this entirely odd sequence begin 3, 7, 13, 19, 29, 31, 37, 41, 43, 47, 53, 59, 73, 79, 97, 101. By the theorems in Banks, there are an infinite number of primes in this sequence.

Examples

			a(0) = 1 because 1 + 2*floor(0*Pi) = 1 + 2*0 = 1 + 0 = 1.
a(1) = 3 because 1 + 2*floor(1*Pi/2) = 1 + 2*floor(1.5707963) = 1 + 2*1 = 3.
a(2) = 7 because 1 + 2*floor(2*Pi/2) = 1 + 2*floor(3.1415926) = 1 + 2*3 = 7.
a(3) = 9 because 1 + 2*floor(3*Pi/2) = 1 + 2*floor(4.7123889) = 1 + 2*4 = 9.
a(4) = 13 because 1 + 2*floor(4*Pi/2) = 1 + 2*floor(6.2831853) = 1 + 2*6 = 13.
a(5) = 15 because 1 + 2*floor(5*Pi/2) = 1 + 2*floor(7.8539816) = 1 + 2*7 = 15.
a(7) = 21 because 1 + 2*floor(7*Pi/2) = 1 + 2*floor(10.995574) = 1 + 2*10 = 21.
		

Crossrefs

Programs

Formula

a(n) = 1 + 2*floor(n*Pi/2).
a(n) = 1 + 2*A140758(n). - L. Edson Jeffery, Mar 16 2013

Extensions

More terms from Stefan Steinerberger, Sep 02 2007
Showing 1-3 of 3 results.