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.

User: Alexis Monnerot-Dumaine

Alexis Monnerot-Dumaine's wiki page.

Alexis Monnerot-Dumaine has authored 9 sequences.

A308712 a(0) = 0 and a(1) = 1; for n > 1, a(n) = a(n-1)/2 if that number is an integer and not already in the sequence, otherwise a(n) = 3*a(n-1) + remainder of a(n-1)/2. (A variant of the Collatz sequence).

Original entry on oeis.org

0, 1, 4, 2, 6, 3, 10, 5, 16, 8, 24, 12, 36, 18, 9, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 60, 30, 15, 46, 23, 70, 35, 106, 53, 160, 80, 240, 120, 360, 180, 90, 45, 136, 68, 204, 102, 51, 154, 77, 232, 116, 58, 29, 88, 44, 132, 66, 33, 100, 50, 25, 76, 38, 19, 58
Offset: 0

Author

Keywords

Comments

Similar to A128333 and related to the 3x+1 (Collatz) sequence. Hits all positive integers?

Examples

			a(1)=1 => a(2)=3*1+1=4 because a(1) is odd => a(3)=4/2=2 because a(2) is even => a(4)=3*2+0=6 because a(3) is even but a(3)/2 is already in the sequence.
		

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := a[n] = With[{b = a[n-1]}, If[EvenQ[b] && FreeQ[Array[a, n, 0], b/2], b/2, 3 b + Mod[b, 2]]];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jun 20 2019 *)

A171587 Sequence of the diagonal variant of the Fibonacci word fractal. Sequence of the Fibonacci tile.

Original entry on oeis.org

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

Author

Keywords

Comments

This is the upper Wythoff sequence (A001950) read mod 2 (for proof see formula section). So a(n) = floor((n+1)*phi^2) mod 2 where phi = (1+sqrt(5))/2. - Michel Dekking, Feb 01 2021
Interpreted as 0=turn right and 1=turn left, this sequence builds the diagonal variant of the Fibonacci word fractal. Base for the construction of the Fibonacci tile (Tiles the plane by translation in 2 ways).
From Michel Dekking, May 03 2018: (Start)
This is a morphic sequence, i.e., the letter to letter projection of a fixed point of a morphism. To see this, one uses the formula which generates (a(n)) from the Dense Fibonacci word A143667. Note that in the Dense Fibonacci word, which is the fixed point of the morphism
0->10221, 1->1022, 2->1021,
the letter 0 exclusively occurs preceded directly by the letter 1. This enables one to create a new letter 3, encoding the word 10, and a morphism
1->322, 2->321, 3->3223221,
which has the property that the letter to letter projection
1->0, 2->1, 3->0
of its fixed point 3,2,2,3,2,2,1,3,2,1,... is equal to (a(n)).
(End)
Also Hofstadter G-sequence (A005206) mod 2. Another morphism can be written in octonary notation as: 0->4, 1->7, 2->5, 3->6, 4->60, 5->53, 6->71, 7->42, where the high bit gives A005614 and the low bit (i.e. "mod 2") gives this A171587 for n>0. The "Missing Words Proof Certificate" found under Links uses this representation to compute missing words of length L = 3, 4, 6, 9, 14, 22. Is there another missing word of length L = 35 as A001611 suggests? - Bradley Klee, Dec 24 2024

Examples

			q[2] = q[1]q[0] = 0,        q[3] = q[2]bar{q[1]} = 01,
q[4] = q[3]bar{q[2]} = 011, q[5] = q[4]q[3] = 01101.
		

Crossrefs

Cf. A001950 (upper Wythoff sequence), A085002 (lower Wythoff sequence mod 2).

Programs

  • Go
    func b(n int) []int {
        a := make([]int, n+1);
        for i:=1; i < n+1; i++ {
            a[i] = i-a[a[i-1]];
        };
        for i:=0; i < n+1; i++ {
            a[i] %= 2;
        };
        return a
    } // Bradley Klee, Dec 25 2024
  • Mathematica
    (* This program supports the conjecture that A171587=(A001950 mod 2). *)
    t = Nest[Flatten[# /. {1 -> {1, 0, 2, 2}, 0 -> {1, 0, 2, 2, 1}, 2 -> {1, 0, 2, 1}}] &, {1}, 5]
    w = DeleteCases[t, 0] /. {1 -> 0, 2 -> 1}
    u = Table[n + Floor[n*GoldenRatio], {n, 1, 500}]; v = Mod[u, 2]
    Table[w[[n]] - v[[n]], {n, 1, 500}] (* supports conjecture for n=1,2,...,500 *)
    (* t=A143667, w=A171587, u=A001950, conjecture: v=w *)

Formula

This sequence is defined by Blondin-Massé et al. as a limit of recursively defined words q[n]. Here q[0] is the empty word, and q[1]=0.
The recursion is given by
q[n]=q[n-1]q[n-2] if n=2 mod 3, and
q[n]=q[n-1]bar{q[n-2]} if n=0 or 1 mod 3,
where bar exchanges 0 and 1.
Also application of the mapping 1->0, 2->1, 0->empty word to the Dense Fibonacci word A143667.
Conjecture: A171587=(A001950 mod 2), as suggested for n=1,2,...,500 by Mathematica program below. - Clark Kimberling, May 31 2011
From Michel Dekking, May 03 2018: (Start)
Proof of Kimberling's 2011 conjecture, i.e., this sequence is the parity sequence of the Upper Wythoff sequence A001950.
The first difference sequence 3, 2, 3, 3, 2, 3, 2, 3, ... of the Upper Wythoff sequence is equal to the unique fixed point of the morphism
beta: 2 -> 3, 3 -> 32 (cf. A282162).
We define the first difference operator D on finite words w by
D(w(1)...w(m)) = (w(2)-w(1))...(w(m)-w(m-1)).
Note that the length of D(w) is one less than the length of w, and note
LEMMA 1: D(vw) = D(v)|w(1)-v(l)|D(w), if v = v(1)...v(l), and w = w(1)...w(m). Here |w(1)-v(l)| is modulo 2.
We also need (easily proved by induction)
LEMMA 2: The last letter of the word q[n] equals 0 if and only if n = 0,1,2 modulo 6.
Almost trivial is
LEMMA 3: The last letter e(n) of beta^n(2) equals 2 if and only if n = 0 modulo 2.
The following proposition implies the conjecture.
PROPOSITION: The difference sequence of q[n] satisfies D(q[n]) = beta^{n-1}(2) e(n-1)^{-1} modulo 2 for n>3.
Note that, by definition, beta^n(2) e(n)^{-1} is just the word beta^n(2), with the last letter removed.
PROOF: By induction. Combine Lemma 1, 2 and 3 in the recursion for the q[n], for n = 0,...,5 modulo 6, using the following table:
n modulo 6 | 0 | 1 | 2 | 3 | 4 | 5 |
last letter of q[n-1] | 1 | 0 | 0 | 0 | 1 | 1 |
first letter of q[n-2]* | 1 | 1 | 0 | 1 | 1 | 0 |
Here q[n-2]* denotes either q[n-2] (if n == 2 (mod 3)), or bar{q[n-2]} (if n == 0,1 (mod 3)).
For example, where all equalities are modulo 2,
D(q[8]) = D(q[7]) 0 D(q[6]) = beta^6(2) f(6) 0 beta^5(2) f(5) = beta^6(2) beta^5(2) f(5) = beta^5(32) f(5) = beta^7(2) f(7),
where f(n):=(e(n) mod 2)^{-1}.
(End)

Extensions

Formula corrected and extended by Michel Dekking, May 03 2018

A171990 Least integer a(n) for which the iterated function log, iterated n times, is defined.

Original entry on oeis.org

1, 2, 3, 16, 3814280
Offset: 1

Author

Keywords

Comments

Log(a(1)) is defined if a(1) > 0, so a(1) = 1.
Log(log(a(2))) is defined if log(a(2)) > 0 => a(2) > 1 => a(2) = 2.
The sequence grows rapidly: a(6) = 2.33150...10^1656520, and is too large to include here.

Examples

			a(2) = 2 because log(log(2)) is defined and log(log(1)) is not;
a(3) = 3 because log(log(log(3))) is defined;
a(4) = 16 because log(log(log(log(16)))) is defined.
From _Robert G. Wilson v_, Jul 05 2022: (Start)
a(3) = ceiling(A001113).
a(4) = ceiling(A073226).
a(5) = ceiling(A073227).
a(6) = ceiling(A085667). (End)
		

Crossrefs

Programs

  • PARI
    a(n) = my(k=1); while(1, my(s=k, i=0); while(s > 0, s=log(s); if(s > 0, i++)); if(i==n-1, return(k)); k++) \\ Felix Fröhlich, Nov 22 2015

Formula

For n > 2, a(n) = ceiling(e^(e^(...))) where e appears n-2 times.

A171588 The Pell word: Fixed point of the morphism 0->001, 1->0.

Original entry on oeis.org

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

Author

Keywords

Comments

From Peter Bala, Nov 22 2013: (Start)
This is a Sturmian word: equals the limit word S(infinity) where S(0) = 0, S(1) = 001 and for n >= 1, S(n+1) = S(n)S(n)S(n-1). See the examples below.
This sequence corresponds to the case k = 2 of the Sturmian word S_k(infinity) as defined in A080764. See A159684 for the case k = 1. (End)
Characteristic word with slope 1 - 1/sqrt(2). Since the characteristic word with slope 1-theta is the mirror image of the characteristic word with slope theta, a(n)= 1 - A080764(n) for all n. - Michel Dekking, Jan 31 2017
The positions of 0 comprise A001951 (Beatty sequence for sqrt(2)); the positions of 1 comprise A001952 (Beatty sequence for 2+sqrt(2)). - Clark Kimberling, May 11 2017
This is also the fixed point of the mapping 00->0010, 01->001, 10->010, starting with 00 [Dekking and Keane, 2022]. See A289001. - N. J. A. Sloane, Mar 09 2022

Examples

			From _Peter Bala_, Nov 22 2013: (Start)
The sequence of words S(n) begins
  S(0) = 0
  S(1) = 001
  S(2) = 001 001 0
  S(3) = 0010010 0010010 001
  S(4) = 00100100010010001 00100100010010001 0010010.
The lengths of the words are [1, 3, 7, 17, 41, ...] = A001333 (apart from the initial term).  (End)
		

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 284.

Programs

  • Magma
    [Floor((n+1)*(1-1/Sqrt(2))-Floor(n*(1-1/Sqrt(2)))): n in [1..100]]; // Vincenzo Librandi, Jan 31 2017
    
  • Maple
    Digits := 50: u := evalf(2 + sqrt(2)): A171588 := n->floor((n+1)/u) - floor(n/u): seq(A171588(n), n = 1..80); # Peter Bala, Nov 22 2013
  • Mathematica
    Table[Floor[(n + 1) (1 - 1/Sqrt[2]) - Floor[n (1 - 1/Sqrt[2])]], {n, 100}] (* Vincenzo Librandi, Jan 31 2017 *)
    Nest[Flatten[# /. {0 -> {0, 0, 1}, 1 -> {0}}] &, {0}, 6] (* Clark Kimberling, May 11 2017 *)
  • Python
    from math import isqrt
    def A171588(n): return 1+isqrt(n**2>>1)-isqrt((n+1)**2>>1) # Chai Wah Wu, May 24 2025

Formula

a(n) = floor((n + 1)/(2 + sqrt(2))) - floor(n /(2 + sqrt(2))). - Peter Bala, Nov 22 2013
a(n) = floor((n+1)*(1 - 1/sqrt(2))) - floor(n*(1 - 1/sqrt(2))). - Michel Dekking, Jan 31 2017

A156596 Infinite Fibonacci word fractal sequence.

Original entry on oeis.org

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

Author

Keywords

Comments

Apply to A143667 the map : 0 -> 12, 1 -> 10, 2 -> 02. or apply to A003849 (the Fibonacci word), after grouping the terms 2 by 2, the map : "00" -> "12", "01"->"10, "10"->"02". Draws the Fibonacci word fractal curve when applying the following drawing rule: if "0" then draw a segment forward, if "1" then draw a segment forward and turn 90A degs right, if "2" the draw segment and turn 90A degs left.

References

  • M. Lothaire, Combinatorics on words, Cambridge University Press.

Crossrefs

Programs

  • Haskell
    a143667 n = a143667_list !! (n-1)
    a143667_list = f a003849_list where
       f (0:0:ws) = 0 : f ws; f (0:1:ws) = 1 : f ws; f (1:0:ws) = 2 : f ws
    -- Reinhard Zumkeller, Jul 29 2014
  • Mathematica
    Partition[Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {0}}]&, {0}, 10], 2] /. {{0, 0} -> {1, 2}, {0, 1} -> {1, 0}, {1, 0} -> {0, 2}} // Flatten (* Jean-François Alcover, Jul 16 2015 *)

A156595 Fixed point of the morphism 0->011, 1->010.

Original entry on oeis.org

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

Author

Keywords

Comments

Start with 0 and apply the morphism 0->011 and 1->010 repeatedly.
This sequence draws the Sierpinski gasket, when iterating the following odd-even drawing rule: If "1" then draw a segment forward, if "0" then draw a segment forward and turn 120 degrees right if in odd position or left if in even position.
From Dimitri Hendriks, Jun 29 2010: (Start)
This sequence is the first difference of the Mephisto Waltz A064990, i.e., a(n) = A064990(n) + A064990(n+1), where '+' is addition modulo 2.
This sequence can also be generated as a Toeplitz word: First consider the periodic word 0,1,$,0,1,$,0,1,$,... and then fill the gaps $ by the bitwise negation of the sequence itself: 0,1,1,0,1,0,0,1,0,.... See the Allouche/Bacher reference for a precise definition of Toeplitz sequences. (End)
From Joerg Arndt, Jan 21 2013: (Start)
Identical to the morphism 0-> 011010010, 1->011010011 given on p. 100 of the Fxtbook (see link), because 0 -> 011 -> 011010010 and 1 -> 010 -> 011010011.
This sequence gives the turns (by 120 degrees) of the R9-dragon curve (displayed on p. 101) which can be rendered as follows:
[Init] Set n=0 and direction=0.
[Draw] Draw a unit line (in the current direction). Turn left/right if a(n) is zero/nonzero respectively.
[Next] Set n=n+1 and goto (draw).
(End)

Examples

			0 -> 0,1,1 -> 0,1,1,0,1,0,0,1,0 -> ...
		

References

  • M. Lothaire, Combinatorics on words.

Crossrefs

Cf. A278996 (indices of 0's), A278997 (indices of 1's), A189717 (partial sums).
Cf. A189628 (morphisms guide).
Cf. A307672 (draws curves that align with the Sierpinski gasket).

Programs

  • Mathematica
    Nest[ Flatten[ # /. {0 -> {0, 1, 1}, 1 -> {0, 1, 0}}] &, {0}, 10]
    SubstitutionSystem[{0->{0,1,1},1->{0,1,0}},0,{5}][[1]] (* Harvey P. Dale, Jan 15 2022 *)
  • Python
    from sympy import integer_log
    def A156595(n): return sum(((m:=(n+1)//9**i)-2)//9+(m-3)//9+(m-5)//9+(m-8)//9+4 for i in range(integer_log(n+1,9)[0]+1))-sum(((m:=n//9**i)-2)//9+(m-3)//9+(m-5)//9+(m-8)//9+4 for i in range(integer_log(n,9)[0]+1)) if n else 0 # Chai Wah Wu, Feb 16 2025

Formula

a(3k-2)=0, a(3k-1)=1, a(3k)=1-a(k) for k>=1, a(0)=0. - Clark Kimberling, Apr 28 2011

A143667 Digits of the infinite Fibonacci word A003849 grouped 2 by 2 and interpreted as a binary value.

Original entry on oeis.org

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

Author

Keywords

Comments

Group 2 by 2 the successive letters of the infinite Fibonacci word A003849 then apply: 00->0, 01->1 and 10->2.
Also result of the following iterated morphism: 1->1022, 0->10221, 2->1021, iterated from letter 1. (Monnerot 2008)
Fractal properties studied (proposed for publication)
(a(n)) is essentially the same sequence as A123564. Simply change the alphabet to {1,2,3}, and permute the letters. The Standard Form of (a(n)) written as a word on the alphabet {a,b,c} is abccabccaabc... . Other forms for this standard form are 1,2,3,3,1,2,3,3,1,1,2,3,.... and 123312331123... - _Michel Dekking, Oct 07 2017
(a(n)) is the fixed point of the 2-block map (called 2-block Fibonacci to the power 3) 00->0100101001, 01->01001010, 10->01001001, followed by the coding above. - Michel Dekking, Sep 26 2017

Examples

			a(1) = 1 because the infinite Fibonacci word starts with "01", a(2) = 0 because it continues with "00", and so on.
		

References

  • M. Lothaire, Combinatorics on words, Cambridge University Press.

Crossrefs

Programs

  • Haskell
    a143667 n = a143667_list !! (n-1)
    a143667_list = f a003849_list where
       f (0:0:ws) = 0 : f ws; f (0:1:ws) = 1 : f ws; f (1:0:ws) = 2 : f ws
    -- Reinhard Zumkeller, Jul 29 2014
  • Mathematica
    Table[3 - (Floor[#1 #2] - 2 Floor[#1 (#2 - 1)] + Floor[#1 (#2 + 1)]) & @@ {1/GoldenRatio, 2 n}, {n, 100}] (* Michael De Vlieger, Oct 06 2017 *)

Formula

a(n) = decimal value of b(2n-1)b(2n), b(n) taken from A003849 (infinite Fibonacci word).

A143668 Result of the morphing 01->01021212, 02->0102121201, 12->01021201, iterated from '01'. Sequence of the Fibonacci word fractal.

Original entry on oeis.org

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

Author

Keywords

Comments

Letter '2' is always in an even position and '0' an odd position.
When replacing '2' by '0', equals the infinite Fibonacci word (see A003849).
This sequence produces the Fibonacci word fractal when applying the following turtle graphics rules: 0->draw segment+turn right, 1-> draw segment, 2-> draw segment+turn left (A. Monnerot-Dumaine 2008 see links).
This sequence is the [1->12, 2->01, 3->02]-transform of A123564. - Michel Dekking, Mar 03 2018

References

  • M. Lothaire, Combinatorics on words, Cambridge University press.

Crossrefs

Formula

Let (b(n)) be the infinite Fibonacci word. if (b(n)=0 and n is even), then a(n)=2, else a(n)=b(n).

A120384 Isolated primes: geometric mean of distances of a prime to neighboring primes sets record.

Original entry on oeis.org

3, 5, 7, 23, 53, 89, 113, 211, 1259, 1327, 1847, 2179, 2503, 5623, 14107, 19661, 24281, 38501, 58831, 268343, 396833, 1272749, 2198981, 3863107, 4411963, 4958131, 5102953, 7950001, 8917523, 10938023, 12623189, 22440841, 24662467, 32616223
Offset: 1

Author

Keywords

Comments

A096265 is based on arithmetic mean or total distance to neighbors. But it doesn't say if it is isolated from them or close to one of them.

Examples

			a(4) = 23 because the distance (geometric mean) to its neighbors (19 and 29) equals = sqrt(4*6) = 4.8989. No smaller prime is more isolated. The next more isolated prime a(5) is 53.
		

Crossrefs

Cf. A096265.

Programs

  • PARI
    lista(nn) = {d = 0; p = 1; q = 2; r = 3; for (i=1, nn, p = q; q = r; r = nextprime(r+1); if ((nd = (q-p)*(r-q)) > d, print1(q, ", "); d = nd;););} \\ Michel Marcus, Jun 12 2013

Extensions

Offset corrected and a(22)-a(34) added by Donovan Johnson, May 23 2010