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

A320441 Numbers whose binary expansion is quasiperiodic.

Original entry on oeis.org

3, 7, 10, 15, 21, 31, 36, 42, 45, 54, 63, 73, 85, 91, 109, 127, 136, 146, 153, 170, 173, 181, 182, 187, 204, 219, 221, 238, 255, 273, 292, 307, 341, 365, 375, 409, 438, 443, 477, 511, 528, 546, 561, 585, 594, 614, 627, 660, 682, 685, 693, 725, 726, 731, 750
Offset: 1

Views

Author

Rémy Sigrist, Jan 09 2019

Keywords

Comments

The binary representation of a term (ignoring leading zeros) can be covered by (possibly overlapping) occurrences of one of its proper prefix.
This sequence contains A121016.
For any k > 0, there are A320434(k)/2 terms with binary length k.

Examples

			The first terms, alongside their binary representations and prefixes, are:
  n   a(n)  bin(a(n))  prefix
  --  ----  ---------  ------
   1     3         11       1
   2     7        111       1
   3    10       1010      10
   4    15       1111       1
   5    21      10101     101
   6    31      11111       1
   7    36     100100     100
   8    42     101010      10
   9    45     101101     101
  10    54     110110     110
  11    63     111111       1
  12    73    1001001    1001
		

Crossrefs

Programs

  • PARI
    isok(w) = { my (tt=0); for (l=1, oo, my (t=w%(2^l)); if (t!=tt, if (t==w, return (0)); my (r=w, g=l); while (g-->=0 && r>=t, r \= 2; if (r%(2^l)==t, if (r==t, return (1), g=l))); tt = t)) }
    
  • Python
    def qp(w):
        for i in range(1, len(w)):
            prefix, covered = w[:i], set()
            for j in range(len(w)-i+1):
                if w[j:j+i] == prefix:
                    covered |= set(range(j, j+i))
            if covered == set(range(len(w))):
                return True
        return False
    def ok(n): return qp(bin(n)[2:])
    print([k for k in range(751) if ok(k)]) # Michael S. Branicky, Mar 20 2022

Formula

A020330(a(n)) belongs to the sequence for any n > 0.
A297405(a(n)) belongs to the sequence for any n > 0.

A337223 a(n) is the least number that can be obtained by replacing some cube XXX in the binary expansion of n by X.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 1, 2, 9, 10, 11, 12, 13, 2, 3, 4, 5, 18, 19, 20, 21, 22, 5, 6, 25, 26, 27, 4, 5, 6, 7, 8, 9, 10, 11, 36, 37, 38, 9, 10, 41, 2, 43, 44, 45, 10, 11, 12, 13, 50, 51, 52, 53, 54, 13, 8, 9, 10, 11, 12, 13, 14, 3, 4, 17, 18, 19, 20, 21, 22, 17
Offset: 0

Views

Author

Rémy Sigrist, Aug 19 2020

Keywords

Comments

Leading zeros in binary expansions are ignored.
Fixed points correspond to A286262.

Examples

			The first terms, in decimal and in binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     2      10         10
   3     3      11         11
   4     4     100        100
   5     5     101        101
   6     6     110        110
   7     1     111          1
   8     2    1000         10
   9     9    1001       1001
  10    10    1010       1010
  11    11    1011       1011
  12    12    1100       1100
  13    13    1101       1101
  14     2    1110         10
  15     3    1111         11
  16     4   10000        100
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(A297405(n)) = n for any n > 0.
Showing 1-2 of 2 results.