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.

A342036 Palindromes of even length only using 0 or 1.

Original entry on oeis.org

0, 11, 1001, 1111, 100001, 101101, 110011, 111111, 10000001, 10011001, 10100101, 10111101, 11000011, 11011011, 11100111, 11111111, 1000000001, 1000110001, 1001001001, 1001111001, 1010000101, 1010110101, 1011001101, 1011111101, 1100000011, 1100110011
Offset: 0

Views

Author

Seiichi Manyama, Feb 26 2021

Keywords

Comments

Subsequence of A057148.
a(n) is a multiple of 11.

Examples

			A006995|A057148|A048701|A342036|A048700|A342040
-------+-------+-------+-------+-------+-------
     0 |     0 |     0 |     0 |       |
     1 |     1 |       |       |     1 |     1
     3 |    11 |     3 |    11 |       |
     5 |   101 |       |       |     5 |   101
     7 |   111 |       |       |     7 |   111
     9 |  1001 |     9 |  1001 |       |
    15 |  1111 |    15 |  1111 |       |
    17 | 10001 |       |       |    17 | 10001
		

Crossrefs

Programs

  • Mathematica
    Array[FromDigits@ Join[#, Reverse[#]] &@ IntegerDigits[#, 2] &, 26, 0] (* Michael De Vlieger, Feb 26 2021 *)
  • Python
    def a(n): b = bin(n)[2:]; return int(b+b[::-1])
    print([a(n) for n in range(27)]) # Michael S. Branicky, Feb 26 2021
  • Ruby
    def A(n)
      str = n.to_s(2)
      (str + str.reverse).to_i
    end
    def A342036(n)
      (0..n).map{|i| A(i)}
    end
    p A342036(30)
    

Formula

a(n) = A007088(n) * 10^A070939(n) + A305989(n).
a(n) = A007088(A048701(n)). - Michel Marcus, Feb 26 2021

Extensions

Offset changed to 0 by Andrey Zabolotskiy, Dec 26 2022

A342040 Binary palindromes of odd length.

Original entry on oeis.org

1, 101, 111, 10001, 10101, 11011, 11111, 1000001, 1001001, 1010101, 1011101, 1100011, 1101011, 1110111, 1111111, 100000001, 100010001, 100101001, 100111001, 101000101, 101010101, 101101101, 101111101, 110000011, 110010011, 110101011
Offset: 1

Views

Author

Seiichi Manyama, Feb 26 2021

Keywords

Comments

Subsequence of A057148.

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := FromDigits[Join[#, {Mod[n, 2]}, Reverse[#]] &@ IntegerDigits[Floor[n/2], 2]]; Array[a, 26] (* Amiram Eldar, Apr 28 2021 *)
  • Python
    def A342040(n):
        s = bin(n)[2:]
        return int(s+s[-2::-1]) # Chai Wah Wu, Feb 26 2021

Formula

a(n) = A007088(A048700(n)).

A342130 Decimal numbers m such that the product of the binary string of m and the binary string of m in reverse contains the binary string of m as a substring.

Original entry on oeis.org

0, 1, 2, 4, 8, 16, 27, 32, 54, 64, 108, 128, 139, 165, 256, 512, 815, 1024, 1630, 2048, 2821, 3167, 3693, 3941, 4096, 4747, 5642, 6334, 7737, 7881, 8192, 9494, 10837, 11284, 12479, 13363, 16384, 18988, 22568, 24669, 24958, 27945, 31205, 32768, 38869, 40861, 45136, 48367, 49338, 49535, 55121
Offset: 1

Views

Author

Scott R. Shannon, Mar 01 2021

Keywords

Comments

All numbers of the form 2^k, k>=0, are in the sequence.

Examples

			8 is a term as bin(8)*reverse(bin(8)) = 100_2*1_2 = 100_2 contains '100' as a substring.
27 is a term as bin(27)*reverse(bin(27)) = 11011_2*11011_2 = 1011011001_2 contains '11011' as a substring.
108 is a term as bin(108)*reverse(bin(108)) = 1101100_2*11011_2 = 101101100100_2 contains '1101100' as a substring.
139 is a term as bin(139)*reverse(bin(139)) = 10001011_2*11010001_2 = 111000101111011_2 contains '10001011' as a substring.
		

Crossrefs

Programs

  • PARI
    strbin(x) = Str(fromdigits(binary(x), 10));
    isok(m) = {my(p = m*fromdigits(Vecrev(binary(m)), 2)); #strsplit(strbin(p), strbin(m)) > 1;} \\ Michel Marcus, Mar 01 2021
Showing 1-3 of 3 results.