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

A091065 Numbers having in binary representation no proper prefix that is also a suffix.

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 12, 14, 16, 20, 24, 26, 28, 30, 32, 40, 44, 48, 50, 52, 56, 58, 60, 62, 64, 72, 80, 84, 88, 92, 96, 98, 100, 104, 106, 108, 112, 114, 116, 118, 120, 122, 124, 126, 128, 144, 152, 160, 164, 168, 172, 176, 180, 184, 188, 192, 194, 196, 200, 202, 208
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 17 2003

Keywords

Comments

A091064(a(n)) = 0, complement of A091066.

Crossrefs

A242869 Largest integer m < n having a binary expansion that is a prefix and a suffix of the binary expansion of n; a(0)=0.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 3, 0, 1, 2, 1, 0, 1, 0, 7, 0, 1, 2, 1, 0, 5, 2, 1, 0, 1, 0, 3, 0, 1, 0, 15, 0, 1, 2, 1, 4, 1, 2, 1, 0, 1, 10, 1, 0, 5, 2, 1, 0, 1, 0, 3, 0, 1, 6, 3, 0, 1, 0, 3, 0, 1, 0, 31, 0, 1, 2, 1, 4, 1, 2, 1, 0, 9, 2, 1, 4, 1, 2, 1, 0, 1, 2, 1, 0, 21
Offset: 0

Views

Author

Alois P. Heinz, May 24 2014

Keywords

Comments

The prefix and the suffix are allowed to overlap.
a(n) <= A147755(n).
a(2^n) = 0.
a(2^n-1) = 2^(n-1)-1 for n>0.
a(n) = 0 iff n in { A091065 }.
a(n) > 1 iff n in { A091066 }.
A029837(a(n)+1) = A091064(n).

Examples

			a(91) = 11 because 91 = (1011)011_2 = 101(1011)_2 and 11 = 1011_2.
a(84) = 0 because 84 = 1010100_2, only the empty bitstring is a proper prefix and suffix.
		

Crossrefs

Cf. A147755.

Programs

  • Maple
    a:= proc(n) local m; m:=n;
          while m>1 do m:= iquo(m, 2);
            if m=irem(n, 2^(1+ilog2(m))) then return m fi
          od; 0
        end:
    seq(a(n), n=0..100);

A091064 In binary representation: length of longest proper prefix of n, that is also a suffix.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 2, 0, 1, 2, 1, 0, 1, 0, 3, 0, 1, 2, 1, 0, 3, 2, 1, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 2, 1, 3, 1, 2, 1, 0, 1, 4, 1, 0, 3, 2, 1, 0, 1, 0, 2, 0, 1, 3, 2, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 2, 1, 3, 1, 2, 1, 0, 4, 2, 1, 3, 1, 2, 1, 0, 1, 2, 1, 0, 5, 2, 1, 0, 1, 2, 4, 0, 3, 2, 1, 0, 1, 0, 2, 0, 1
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 17 2003

Keywords

Comments

a(n) <= A070939(n)-1 by definition;
a(2^k-1)=k-1; for k>0: a(2^k+1)=1; for k>2: a(2^k+2)=2;
a(A091065(n)) = 0, a(A091066(n)) > 0.

Crossrefs

A342378 List of numbers whose binary expansion is an instance of the Zimin pattern ABA.

Original entry on oeis.org

5, 7, 9, 11, 13, 15, 17, 18, 19, 21, 22, 23, 25, 27, 29, 31, 33, 34, 35, 37, 38, 39, 41, 42, 43, 45, 46, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 85, 86, 87, 89, 90, 91, 93, 94, 95, 97, 99, 101
Offset: 1

Views

Author

Peter Kagey, Mar 09 2021

Keywords

Comments

This is A091066 with some terms of A020330 removed.

Examples

			The binary expansion of 182 is 10110110, which is an instance of the pattern ABA with A=10 and B=1101.
		

Crossrefs

Programs

  • Python
    def ok(n):
      b = bin(n)[2:]
      for i in range(1, (len(b)+1)//2):
        if b[:i] == b[-i:]: return True
      return False
    def aupto(lim): return [m for m in range(lim+1) if ok(m)]
    print(aupto(101)) # Michael S. Branicky, Mar 09 2021
Showing 1-4 of 4 results.