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

A048707 Numerators of ratios converging to Thue-Morse constant.

Original entry on oeis.org

0, 1, 6, 105, 27030, 1771476585, 7608434000728254870, 140350834813144189858090274002849666665, 47758914269546354982683078068829456704164423862093743397580034411621752859030
Offset: 0

Views

Author

Antti Karttunen, Mar 09 1999

Keywords

Comments

Also interpret each iteration of the construction of the Thue-Morse constant as a binary number converted to a decimal number. Thus (0_b, 01_b, 0110_b, 01101001_b ...) gives the present sequence in decimal. - Robert G. Wilson v, Sep 22 2006
a(n) corresponds to the binary value of the truth-table for the xor operator with n-arguments. - Joe Riel (joer(AT)san.rr.com), Jan 31 2010

Crossrefs

The denominators are given by A001146. Consists of every 2^n-th term of A019300. Cf. A048708 (same sequence in hexadecimal) and A014571, A010060, A014572.

Programs

  • Mathematica
    Table[ FromDigits[ Nest[ Flatten[ #1 /. {0 -> {0, 1}, 1 -> {1, 0}}] &, {0}, n], 2], {n, 0, 8}] (* Robert G. Wilson v, Sep 22 2006 *)
  • Scheme
    ;returns all but the last element of a list
    (define rdc(lambda(x)(if(null? (cdr x))'()(cons (car x) (rdc (cdr x))))))
    ;gets the two's complement of a given bit
    (define twosComplement (lambda (x)(if (eq? x #\0) "1" "0" )))
    ;gets the two's complement of a string
    (define complementOfCurrent (lambda (x y z)(if (eq? (string-length y) z) y (complementOfCurrent (list->string (cdr (string->list x))) (string-append y (twosComplement (string-ref x 0))) z))))
    ;concatenates the two's complement of a string onto the current string, giving the next element in the TM sequence
    (define concatenateComplement (lambda (x i)(if(zero? i) x (concatenateComplement(string-append x (complementOfCurrent x "" (string-length x)))(- i 1)))))
    ;generates the TM sequence of length 2^x
    (define generateThue (lambda (x)(concatenateComplement "0" x)))
    ;if a bit is 1, get 2^i, where i is the index of that bit from right-left
    (define F (lambda (c i)(if (eq? c #\1) (expt 2 i) 0)))
    ;gathers the sum of 2^index for all indices corresponding to a 1
    (define fn (lambda (x sum i stop)(if (eq? i stop) sum (fn (list->string (rdc (string->list x))) (+ sum (F (string-ref x (-(string-length x) 1)) i)) (+ i 1)stop))))
    (define f (lambda (x)(fn (generateThue x) 0 0 (string-length (generateThue x)))))
    ;format: (f x)
    ;example: (f 10)
    ;by Ariel S Koiman, Apr 23 2013

Formula

a(0) = 0, a(n) = (a(n-1)+1)*((2^(2^(n-1)))-1).

A085394 Numerators of convergents to Thue-Morse constant.

Original entry on oeis.org

0, 1, 2, 5, 7, 33, 106, 563, 1232, 1795, 8412, 18619, 27031, 153774, 6793087, 6946861, 34580531, 41527392, 117635315, 512068652, 629703967, 1141772619, 1771476586, 9999155549, 141759654272, 151758809821, 7729700145322, 116097260989651
Offset: 1

Views

Author

Gary W. Adamson, Jun 27 2003

Keywords

Examples

			[2,2,2,1,4] = 33/80 = .4125
		

Crossrefs

Cf. A014571, A014572, A085395 (companion denominators).

Programs

  • Mathematica
    mt = 0; Do[ mt = ToString[mt] <> ToString[(10^(2^n) - 1)/9 - ToExpression[mt]], {n, 0, 7}]; d = RealDigits[ N[ ToExpression[mt], 2^7]][[1]]; a = 0; Do[ a = a + N[ d[[n]]/2^(n + 1), 100], {n, 1, 2^7}]; f[n_] := FromContinuedFraction[ ContinuedFraction[a, n]]; Table[ Numerator[f[n]], {n, 1, 28}]

Formula

In continued fraction form, the Thue-Morse constant .4124540336401...; is [2, 2, 2, 1, 4, 3, 5, 2, 1, 4...], with A014572(1) = 2, the first partial quotient. Underneath each term we write the convergents corresponding to the continued fraction: [2] = 1/2, [2, 2] = 2/5, [2, 2, 2] = 5/12 and so on, the convergents being: 1/2, 2/5, 5/12, 7/17, 33/80, 106/257, 563/1365, 1232/2987, 1795/4352, 8412/20395...where the latter = .412454032...

Extensions

Edited by Robert G. Wilson v, Jul 15 2003

A085395 Denominators of convergents to the Thue-Morse constant 0.41245403364...

Original entry on oeis.org

1, 2, 5, 12, 17, 80, 257, 1365, 2987, 4352, 20395, 45142, 65537, 372827, 16469925, 16842752, 83840933, 100683685, 285208303, 1241516897, 1526725200, 2768242097, 4294967297, 24243078582, 343698067445, 367941146027, 18740755368795
Offset: 1

Views

Author

Gary W. Adamson, Jun 27 2003

Keywords

Examples

			[2, 2, 2, 1, 4] = 33/80 = 0.4125.
		

Crossrefs

Companion numerators are A085394.

Programs

  • Mathematica
    mt = 0; Do[ mt = ToString[mt] <> ToString[(10^(2^n) - 1)/9 - ToExpression[mt]], {n, 0, 7}]; d = RealDigits[ N[ ToExpression[mt], 2^7]][[1]]; a = 0; Do[ a = a + N[ d[[n]]/2^(n + 1), 100], {n, 1, 2^7}]; f[n_] := FromContinuedFraction[ ContinuedFraction[a, n]]; Table[ Denominator[f[n]], {n, 1, 28}]

Formula

Write the convergents directly underneath the partial quotients (A014572) for 0.412454033... starting with the first partial quotient, 2: [2, 2, 2, 1, 4, 3, 5, 2, 1, 4, ...] such that [2] = 1/2, [2, 2] = 2/5, [ 2, 2, 2] = 5/12 and so on, the convergents being: 1/2, 2/5, 5/12, 7/17, 33/80, 106, 257, 563/1365, 1232/2987, 1795/4352, 8412/20395, ...

Extensions

Edited by Robert G. Wilson v, Jul 15 2003

A085396 Numerator and denominator sums of convergents to the Thue-Morse constant, 0.412454033...

Original entry on oeis.org

1, 3, 7, 17, 24, 113, 363, 1928, 4219, 6147, 28807, 63761, 92568, 526601, 23263012, 23789613, 118421464, 142211077, 402843618, 1753585549, 2156429167, 3910014716, 6066443883, 34242234131, 485457721717, 519699955848
Offset: 1

Views

Author

Gary W. Adamson, Jun 27 2003

Keywords

Comments

Let k = 0.412454..., then A085396(n)/A085394(n) [i.e., (numerator + denominator)/(numerator)] converges upon 3.424512... as n approaches infinity, where 3.424... = (k+1)/k. A085396(n)/A085395(n) [i.e., (numerator + denominator)/(denominator)], converges upon k+1, = 1.412454... Check: A085396(6)/A085394(6) = 363/106 = 3.4245...; while A085396(6)/A085395(6) = 393/257 = 1.41245... The constants (k+1) and (k+1)/k are generators for the Beatty pairs for the Thue-Morse constant, where the pairs are [(n*(k+1), (n*(k+1)/k], n = 1,2,3,...

Examples

			Convergents to the Thue-Morse constant 0.4124540336... are derived from continued fraction form shown in A014572, starting with A014572(1) = 2; then 0.412454... = [2, 2, 2, 1, 4, 3, 5, 2, 1, ...] (A014572). Example [2] = 1/2, [2,2] = 2/5, [2,2,2] = 5/12 and so on.
		

Crossrefs

Programs

  • Mathematica
    mt = 0; Do[ mt = ToString[mt] <> ToString[(10^(2^n) - 1)/9 - ToExpression[mt]], {n, 0, 7}];
    d = RealDigits[ N[ ToExpression[mt], 2^7]][[1]];
    a = 0; Do[ a = a + N[ d[[n]]/2^(n + 1), 100], {n, 1, 2^7}];
    f[n_] := FromContinuedFraction[ ContinuedFraction[a, n]];
    Table[ Numerator[ f[n]] + Denominator[ f[n]], {n, 2, 27}]

Formula

a(n) = A085394(n) + A085395(n) = numerator and denominator sums for convergents of 0.412454..., the convergents being 1/2, 2/5, 5/12, 7/17, 33/80, 106/257, 563/1365, 1232/2987, 1795/4352, 8412/20395, ...

Extensions

Edited by Robert G. Wilson v, Jul 15 2003

A122497 Let f(S) denote the interchange of 1's and 2's in S. Let S_0 = 1, S_{N+1} = f(S_N).S_N, where the dot indicates concatenation. Sequence gives S_0.S_1.S_2.S_3....

Original entry on oeis.org

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

Views

Author

Roger L. Bagula, Sep 15 2006

Keywords

Comments

An alternating triangular Morse-Thue sequence based on A010060 using {1,2} instead of {0,1} substitutions.

Examples

			The first few S_i are:
1
2, 1
1, 2, 2, 1
2, 1, 1, 2, 1, 2, 2, 1
1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1
		

Crossrefs

Programs

  • Mathematica
    ThueMorse[n_, b_] := Nest[Flatten[ # /. {1 -> {1, 2}, 2 -> {2, 1}}] &, {b}, n] a = Table[ThueMorse[n, 1 + Mod[n, 2]], {n, 0, 7}] Flatten[a]

Formula

a(n) = A059448(n) + 1. - Filip Zaludek, Dec 10 2016

Extensions

Edited by N. J. A. Sloane, May 22 2007
Showing 1-5 of 5 results.