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.

A018846 Strobogrammatic numbers: numbers that are the same upside down (using calculator-style numerals).

Original entry on oeis.org

0, 1, 2, 5, 8, 11, 22, 55, 69, 88, 96, 101, 111, 121, 151, 181, 202, 212, 222, 252, 282, 505, 515, 525, 555, 585, 609, 619, 629, 659, 689, 808, 818, 828, 858, 888, 906, 916, 926, 956, 986, 1001, 1111, 1221, 1551, 1691, 1881, 1961, 2002, 2112, 2222, 2552, 2692, 2882
Offset: 1

Views

Author

Keywords

Comments

A018847 lists primes in this sequence. - M. F. Hasler, May 05 2012

Crossrefs

Cf. A053701 (vertically symmetric numbers), A048708.

Programs

  • PARI
    is_A018846(n,t=Vec("012..59.86"))={ apply(x->t[eval(x)+1], n=Vec(Str(n)))==vecextract(n, "-1..1") } \\ M. F. Hasler, May 05 2012
    
  • Python
    from itertools import count, islice, product
    def ud(s): return s[::-1].translate({ord('6'):ord('9'), ord('9'):ord('6')})
    def A018846gen(): # generator of terms
        yield from [0, 1, 2, 5, 8]
        for d in count(2):
            for first in "125689":
                for rest in product("0125689", repeat=d//2-1):
                    left = first + "".join(rest)
                    for mid in [[""], ["0", "1", "2", "5", "8"]][d%2]:
                        yield int(left + mid + ud(left))
    print(list(islice(A018846gen(), 54))) # Michael S. Branicky, Jul 09 2022

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

A048705 The rule numbers for 1-D CA composed of Rules "90" and "150" so that each direction occurs only once.

Original entry on oeis.org

90, 150, 1721342310, 140117185019831836588493434554119984790, 113427455640312821160607117168492587690
Offset: 1

Views

Author

Antti Karttunen, Mar 09 1999

Keywords

Comments

The "numerator" (0, 1 and the rest from A020652) is the multiplicity of the "Rule 150" component and the "denominator" (1, 0 and the rest from A020653) is the multiplicity of the "Rule 90" component.
The resulting numbers define one-dimensional linear cellular automata with radius being the sum of the number of the "90" and "150" components.
In hexadecimal the sequence is 5A, 96, 66999966, 69699696969669699696696969699696, 5555555555555555AAAAAAAAAAAAAAAA, ...

Crossrefs

A048706 gives the corresponding "XOR-conjugate" rules.
Cf. A038183, A038184, A048709 (for specific examples). See also A048708, A048720.

Programs

  • Maple
    # The definitions of bit_i and floor_log_2 are given in A048700
    rule90 := proc(seed,n) option remember: local sl, i: if (0 = n) then (seed) else sl := floor_log_2(seed+1); add(((bit_i(rule90(seed,n-1),i)+bit_i(rule90(seed,n-1),i-2)) mod 2)*(2^i), i=0..(2*n)+sl) fi: end:
    rule150 := proc(seed,n) option remember: local sl, i: if (0 = n) then (seed) else sl := floor_log_2(seed+1);
    add(((bit_i(rule150(seed,n-1),i)+bit_i(rule150(seed,n-1),i-1)+bit_i(rule150(seed,n-1),i-2)) mod 2)*(2^i), i=0..((2*n)+sl)) fi: end:
    # Rule 90 and Rule 150 are commutative in respect to each other:
    rule90x150combination := proc(n) local p,q,i; p := extended_A020652[ n ]; # the Rule 150 component [ 0,1,op(A020652) ]
    q := extended_A020653[ n ]; # the Rule 90 component [ 1,0,op(A020653) ]
    RETURN(sum('bit_i(rule150(rule90(i,q),p),(2*(p+q))) * (2^i)','i'=0..(2^((2*(p+q))+1))-1));
    end:

Formula

a(n) = rule90x150combination(n) # See the Maple procedures below.
Showing 1-3 of 3 results.