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.

A284749 {001->2}-transform of the infinite Fibonacci word A003849.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 02 2017

Keywords

Comments

From Daniel Rust, Aug 18 2018: (Start)
This word is the fixed point of the morphism 0->2, 1->01, 2->2201 with the finite string 0, 1, 2, 0, 1 appended to the beginning. This morphism comes from taking the 'proper' version of the Fibonacci morphism 0->01, 1->1, given by 0->001, 1->01 (A189661 but with the rightmost 0 moved to the left of each image word), then replacing 001 with 2 and noting that the new symbol 2 should map to 00100101 = 2201 in order to be consistent.
The finite string appended to the beginning comes from the process of finding a proper version of the Fibonacci morphism using a return word encoding and taking conjugates which causes a shift of the respective fixed points.
(End)
This sequence is the unique fixed point of the morphism 0->01, 1->2, 2->0122. See the paragraph following Lemma 23 in the paper by Allouche and me. - Michel Dekking, Oct 05 2018

Examples

			As a word, A003849 = 01001010010010100..., and replacing each 001 by 2 gives 01201220120...
		

Crossrefs

Programs

  • Mathematica
    s = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {0}}] &, {0}, 13]  (* A003849 *)
    w = StringJoin[Map[ToString, s]]
    w1 = StringReplace[w, {"001" -> "2"}]
    st = ToCharacterCode[w1] - 48 (* A284749 *)
    Flatten[Position[st, 0]]  (* A214971 *)
    Flatten[Position[st, 1]]  (* A284624 *)
    Flatten[Position[st, 2]]  (* A284625 *)
  • Python
    from math import isqrt
    def A284624(n): return (n<<1)+(n-1+isqrt(5*(n-1)**2)>>1)
    def A284625(n): return (n+isqrt(5*n**2)&-2)-n+2
    def A284749(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
        for i, f in enumerate((A284624, A284625),1):
            if f(bsearch(f,n))==n: return i
        return 0 # Chai Wah Wu, May 22 2025

A284624 Positions of 1 in A284749.

Original entry on oeis.org

2, 5, 9, 12, 16, 20, 23, 27, 30, 34, 38, 41, 45, 49, 52, 56, 59, 63, 67, 70, 74, 77, 81, 85, 88, 92, 96, 99, 103, 106, 110, 114, 117, 121, 125, 128, 132, 135, 139, 143, 146, 150, 153, 157, 161, 164, 168, 172, 175, 179, 182, 186, 190, 193, 197, 200, 204, 208
Offset: 1

Views

Author

Clark Kimberling, May 02 2017

Keywords

Comments

This sequence and A214971 and A284625 partition the positive integers into sequences with slopes t = (5+sqrt(5))/2, u = (5+sqrt(5))/2, v = sqrt(5), where 1/t + 1/u + 1/v = 1. The positions of 0 in A284749 are given by A214971, and of 2, by A284625.

Examples

			As a word, A284749 = 012012201201220122..., in which 1 is in positions 2,5,9,12,...
		

Crossrefs

Programs

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

Formula

Conjectured: a(n) = 1 + A214971(n).
Proof of this conjecture: it is easy to see that the infinite Fibonacci word A003849 is a concatenation of the words 01 and 001. So if we replace all 001 by 2, only the 01 remain, i.e., every 0 is directly followed by 1. - Michel Dekking, Aug 19 2018
a(n) = floor((n-1)*phi) + 2*(n-1) + 2 (Theorem 31 in Allouche and Dekking). - Michel Dekking, Oct 08 2018

A284611 Number of partitions of n such that the (sum of all even parts) = floor(n/2).

Original entry on oeis.org

1, 0, 0, 1, 2, 0, 0, 4, 6, 0, 0, 12, 15, 0, 0, 30, 40, 0, 0, 70, 84, 0, 0, 165, 198, 0, 0, 330, 405, 0, 0, 704, 836, 0, 0, 1380, 1620, 0, 0, 2688, 3192, 0, 0, 4984, 5824, 0, 0, 9394, 10934, 0, 0, 16665, 19392, 0, 0, 29970, 34560, 0, 0, 52096
Offset: 1

Views

Author

Clark Kimberling, Mar 30 2017

Keywords

Examples

			a(8) counts these 3 partitions: 44, 431, 4111.
		

Crossrefs

Programs

  • Mathematica
    Table[p = IntegerPartitions[n];
     Length[Select[Table[Total[Select[p[[k]], EvenQ]], {k, Length[p]}], # ==
         Floor[n/2] &]], {n, 60}]
Showing 1-3 of 3 results.