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.

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).

A377029 a(1) = 0; thereafter in the binary expansion of a(n-1), expand bits: 1->01 and 0->10.

Original entry on oeis.org

0, 2, 6, 22, 406, 92566, 6818458006, 26055178074437806486, 540213899028732737068658940860686756246, 163551003506862550406254063077517364557434408527734307437037618419534882498966
Offset: 1

Views

Author

Darío Clavijo, Oct 13 2024

Keywords

Comments

All terms are even and leading zeros omitted in the final encoding.
Conversely the opposite mapping of bits: 0->01 and 1->10 is A133468.
The bit length of a(n) is 2^(n-1)+1.
The count of bits set for a(n) is A094373(n).
a(n) = 2 (mod 4) for n > 1.
Also all the terms align bitwise to the right.
The hamming distance of a(n) and a(n+1) is in A000079.

Examples

			For n = 5 a(5) = 406 because:
This encoding results in the following tree:
n | a(n)
--+---------------
1 | 0
  | |\
2 | 1 0
  | | |
3 | 1 10
  | | | \
4 | 1 01 10--
  | | |\  \  \
  | | | \  \  \
5 | 1 10 01 01 10
Which also aligns bitwise to the right:
n | a(n)
--+-----------
1 |         0
2 |        10
3 |       110
4 |     10110
5 | 110010110
And 110010110 in base 10 is 406.
		

Crossrefs

Programs

  • Mathematica
    NestList[FromDigits[2 - IntegerDigits[#, 2], 4] &, 0, 10] (* Paolo Xausa, Nov 04 2024 *)
  • Python
    from functools import cache
    A374625 = lambda n: int(bin(n)[2:].replace('0', '2'), 4)
    @cache
    def a(n):
      if n == 1: return 0
      return A374625(a(n-1))
    print([a(n) for n in range(1, 12)])

Formula

a(n) = A320916(2^(n-2)+1) for n > 1.
A000120(a(n+1) XOR a(n)) = A000079(n-2).
a(n) = A374625(a(n-1)) for n > 1. - Paolo Xausa, Nov 04 2024

A337672 Numbers with binary expansion Sum_{k = 0..w} b_k * 2^k such that the polynomial Sum_{k = 0..w} (X+k)^2 * (-1)^b_k is constant.

Original entry on oeis.org

0, 9, 150, 153, 165, 195, 2268, 2282, 2289, 2364, 2394, 2406, 2409, 2454, 2457, 2469, 2499, 2618, 2646, 2649, 2661, 2702, 2709, 2723, 2829, 2835, 3126, 3129, 3150, 3157, 3171, 3213, 3219, 3339, 3591, 34680, 34740, 34764, 34770, 34785, 35576, 35700, 35756
Offset: 1

Views

Author

Rémy Sigrist, Sep 15 2020

Keywords

Comments

Leading 0's in binary expansions are ignored.
Positive terms are digitally balanced (A031443).
If m belongs to the sequence, then A056539(m) also belongs to the sequence.
If m and n belong to the sequence, then their binary concatenation also belongs to the sequence (assuming the concatenation with 0 is neutral).

Examples

			The first 16 integers, alongside their binary representations and associate polynomials, are:
  k   bin(k)  P(k)
  --  ------  --------------
   0       0               0
   1       1            -X^2
   2      10           2*X+1
   3      11    -2*X^2-2*X-1
   4     100       X^2+6*X+5
   5     101      -X^2-2*X-3
   6     110      -X^2+2*X+3
   7     111    -3*X^2-6*X-5
   8    1000   2*X^2+12*X+14
   9    1001              -4
  10    1010           4*X+6
  11    1011   -2*X^2-8*X-12
  12    1100          8*X+12
  13    1101    -2*X^2-4*X-6
  14    1110        -2*X^2+4
  15    1111  -4*X^2-12*X-14
We have constant polynomials for k = 0 and k = 9, so a(1) = 0 and a(2) = 9.
		

Crossrefs

Programs

  • PARI
    is(n) = { my (b=Vecrev(binary(n))); poldegree(p=sum(k=1, #b, ('X+k-1)^2 * (-1)^b[k]))<=0 }
Showing 1-3 of 3 results.