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.

A048707 Numerators of ratios converging to Thue-Morse constant.

This page as a plain text file.
%I A048707 #28 Feb 16 2025 08:32:40
%S A048707 0,1,6,105,27030,1771476585,7608434000728254870,
%T A048707 140350834813144189858090274002849666665,
%U A048707 47758914269546354982683078068829456704164423862093743397580034411621752859030
%N A048707 Numerators of ratios converging to Thue-Morse constant.
%C A048707 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
%C A048707 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
%H A048707 Ariel S Koiman, <a href="/A048707/b048707.txt">Table of n, a(n) for n = 0..11</a> (shortened by _N. J. A. Sloane_, Jan 13 2019)
%H A048707 Beeler, M., Gosper, R. W. and Schroeppel, R., <a href="http://www.inwap.com/pdp10/hbaker/hakmem/series.html#item122">HAKMEM, ITEM 122 (Schroeppel, Gosper)</a>
%H A048707 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Thue-MorseSequence.html">Thue-Morse Sequence</a>
%F A048707 a(0) = 0, a(n) = (a(n-1)+1)*((2^(2^(n-1)))-1).
%t A048707 Table[ FromDigits[ Nest[ Flatten[ #1 /. {0 -> {0, 1}, 1 -> {1, 0}}] &, {0}, n], 2], {n, 0, 8}] (* _Robert G. Wilson v_, Sep 22 2006 *)
%o A048707 (Scheme)
%o A048707 ;returns all but the last element of a list
%o A048707 (define rdc(lambda(x)(if(null? (cdr x))'()(cons (car x) (rdc (cdr x))))))
%o A048707 ;gets the two's complement of a given bit
%o A048707 (define twosComplement (lambda (x)(if (eq? x #\0) "1" "0" )))
%o A048707 ;gets the two's complement of a string
%o A048707 (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))))
%o A048707 ;concatenates the two's complement of a string onto the current string, giving the next element in the TM sequence
%o A048707 (define concatenateComplement (lambda (x i)(if(zero? i) x (concatenateComplement(string-append x (complementOfCurrent x "" (string-length x)))(- i 1)))))
%o A048707 ;generates the TM sequence of length 2^x
%o A048707 (define generateThue (lambda (x)(concatenateComplement "0" x)))
%o A048707 ;if a bit is 1, get 2^i, where i is the index of that bit from right-left
%o A048707 (define F (lambda (c i)(if (eq? c #\1) (expt 2 i) 0)))
%o A048707 ;gathers the sum of 2^index for all indices corresponding to a 1
%o A048707 (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))))
%o A048707 (define f (lambda (x)(fn (generateThue x) 0 0 (string-length (generateThue x)))))
%o A048707 ;format: (f x)
%o A048707 ;example: (f 10)
%o A048707 ;by _Ariel S Koiman_, Apr 23 2013
%Y A048707 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.
%Y A048707 Cf. A080814, A080815, A133468.
%K A048707 nonn,frac
%O A048707 0,3
%A A048707 _Antti Karttunen_, Mar 09 1999