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

A330524 Lexicographically earliest sequence of positive terms such that for any distinct i and j, a(i) | a(j+1) <> a(j) | a(j+1) (where "|" corresponds to binary concatenation, A163621).

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 2, 3, 3, 4, 1, 4, 2, 4, 3, 5, 2, 5, 3, 6, 1, 8, 1, 9, 2, 8, 2, 9, 3, 7, 4, 4, 5, 4, 8, 3, 8, 4, 9, 4, 10, 2, 11, 2, 13, 1, 10, 4, 11, 3, 9, 5, 8, 5, 9, 6, 4, 15, 2, 16, 1, 16, 2, 17, 2, 18, 4, 16, 3, 10, 5, 10, 6, 5, 11, 4, 17, 3, 11, 5, 14
Offset: 1

Views

Author

Rémy Sigrist, Dec 17 2019

Keywords

Comments

This sequence is a binary variant of A318225.
This sequence has similarities with A088177; here we combine successive terms by concatenation, there by multiplication.
This sequence is necessarily unbounded.
Also, the value 1 appears infinitely many times.

Examples

			The first terms, alongside their binary representation and that of the concatenation of two consecutive terms, are:
  n   a(n)  bin(a(n))  bin(a(n)|a(n+1))
  --  ----  ---------  ----------------
   1     1          1                11
   2     1          1               110
   3     2         10               101
   4     1          1               111
   5     3         11              1110
   6     2         10              1010
   7     2         10              1011
   8     3         11              1111
   9     3         11             11100
  10     4        100              1001
  11     1          1              1100
  12     4        100             10010
		

Crossrefs

See A330525 for the concatenation of consecutive terms.

Programs

  • PARI
    s=0; v=1; for (n=1, 81, print1 (v", "); for (w=1, oo, if (!bittest(s, k=v*2^#binary(w)+w), s+=2^k; v=w; break)))

A294977 Square array T(n, k) read by antidiagonals, n > 0 and k > 0: T(n, k) is the smallest positive integer that, when written in binary, contains both binary n and binary k as substrings.

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 4, 6, 6, 4, 5, 4, 3, 4, 5, 6, 5, 12, 12, 5, 6, 7, 6, 11, 4, 11, 6, 7, 8, 14, 6, 20, 20, 6, 14, 8, 9, 8, 7, 12, 5, 12, 7, 8, 9, 10, 9, 24, 28, 13, 13, 28, 24, 9, 10, 11, 10, 19, 8, 23, 6, 23, 8, 19, 10, 11, 12, 11, 26, 9, 40, 14, 14, 40, 9, 26
Offset: 1

Views

Author

Rémy Sigrist, Mar 02 2018

Keywords

Comments

When computing T(n, k), we have three situations:
- the binary representation of n appears in the binary representation of k or vice versa; then T(n, k) = max(n, k); for example T(1, 2) = 2,
- otherwise a strict suffix of the binary representation of n equals a strict prefix of the binary representation of k or vice versa; then max(n, k) < T(n, k) < min(A163621(n, k), A163621(k, n)); for example T(2, 3) = 6,
- otherwise the binary representations of n and of k do not overlap; then T(n, k) = min(A163621(n, k), A163621(k, n)); for example T(10, 12) = 172.

Examples

			Array T(n, k) begins (in decimal):
  n\k|    1    2    3    4    5    6    7    8    9   10   11   12
  ---+------------------------------------------------------------
    1|    1    2    3    4    5    6    7    8    9   10   11   12
    2|    2    2    6    4    5    6   14    8    9   10   11   12
    3|    3    6    3   12   11    6    7   24   19   26   11   12
    4|    4    4   12    4   20   12   28    8    9   20   44   12
    5|    5    5   11   20    5   13   23   40   37   10   11   44
    6|    6    6    6   12   13    6   14   24   25   26   22   12
    7|    7   14    7   28   23   14    7   56   39   58   23   28
    8|    8    8   24    8   40   24   56    8   72   40   88   24
Array T(n, k) begins (in binary):
   n\k|     1    10     11    100     101    110      111    1000     1001    1010
  ----+---------------------------------------------------------------------------
     1|     1    10     11    100     101    110      111    1000     1001    1010
    10|    10    10    110    100     101    110     1110    1000     1001    1010
    11|    11   110     11   1100    1011    110      111   11000    10011   11010
   100|   100   100   1100    100   10100   1100    11100    1000     1001   10100
   101|   101   101   1011  10100     101   1101    10111  101000   100101    1010
   110|   110   110    110   1100    1101    110     1110   11000    11001   11010
   111|   111  1110    111  11100   10111   1110      111  111000   100111  111010
  1000|  1000  1000  11000   1000  101000  11000   111000    1000  1001000  101000
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(n, n) = n.
T(n, 1) = n.
T(n, k) = T(k, n).
T(T(n, k), k) = T(n, k) (for any fixed n > 0, the function k -> T(n, k) is a projection).
A165819(n) = T(n, 2*n-1).
A165820(n) = T(n, n^2).
A165821(n) = T(n, A000040(n)).
A165822(n) = T(n, A000045(n)).
T(n, k) >= n with equality iff the binary representation of k appears in the binary representation of n.
T(n, k) >= max(n, k).
T(n, k) <= min(A163621(n, k), A163621(k, n)) with equality iff the binary representations of n and of k do not overlap.

A330525 The binary representation of a(n) is the concatenation of that of A330524(n) and of A330524(n+1).

Original entry on oeis.org

3, 6, 5, 7, 14, 10, 11, 15, 28, 9, 12, 18, 20, 19, 29, 22, 21, 23, 30, 13, 24, 17, 25, 38, 40, 34, 41, 39, 31, 60, 36, 37, 44, 72, 35, 56, 68, 73, 76, 74, 42, 43, 46, 45, 27, 26, 84, 75, 47, 57, 77, 88, 69, 89, 78, 52, 79, 62, 80, 33, 48, 66, 81, 70, 82, 148
Offset: 1

Views

Author

Rémy Sigrist, Dec 17 2019

Keywords

Comments

Does this sequence contain every positive number except powers of 2?

Crossrefs

Programs

  • PARI
    s=0; v=1; for (n=1, 66, for (w=1, oo, if (!bittest(s, k=v*2^#binary(w)+w), print1 (k", "); s+=2^k; v=w; break)))

Formula

a(n) = A163621(A330524(n), A330524(n+1)).

A362022 a(n) is the least positive integer whose binary expansion is the concatenation of the binary expansions of two numbers whose product is n.

Original entry on oeis.org

3, 5, 7, 9, 11, 11, 15, 17, 15, 21, 23, 19, 27, 23, 23, 33, 35, 27, 39, 37, 31, 43, 47, 35, 45, 45, 39, 39, 59, 43, 63, 65, 47, 69, 47, 51, 75, 77, 55, 69, 83, 55, 87, 75, 63, 87, 95, 67, 63, 85, 71, 77, 107, 75, 91, 71, 79, 93, 119, 79, 123, 95, 79, 129, 93
Offset: 1

Views

Author

Rémy Sigrist, Apr 05 2023

Keywords

Comments

For any prime number p, a(p) is the least of the binary concatenation of p with 1 or the binary concatenation of 1 with p.

Examples

			The first terms, alongside their binary expansion split into two parts, are:
  n   a(n)  bin(a(n))
  --  ----  ---------
   1     3  1|1
   2     5  10|1
   3     7  11|1
   4     9  100|1
   5    11  101|1
   6    11  10|11
   7    15  111|1
   8    17  1000|1
   9    15  11|11
  10    21  1010|1
  11    23  1011|1
  12    19  100|11
  13    27  1101|1
  14    23  10|111
  15    23  101|11
		

Crossrefs

Cf. A070939, A163621, A362023 (decimal variant).

Programs

  • Mathematica
    Table[Min@ Map[FromDigits[Join @@ #, 2] &, Join @@ {#, Reverse /@ #}] &@ Map[IntegerDigits[#, 2] &, Transpose@{#, n/#}, {2}] &@ TakeWhile[Divisors[n], # <= Sqrt[n] &], {n, 60}] (* Michael De Vlieger, Apr 07 2023 *)
  • PARI
    a(n, base = 2) = { my (v = oo); fordiv (n, d, v = min(v, n/d * base^#digits(d, base) + d);); return (v); }
    
  • Python
    from sympy import divisors
    def a(n): return min(d+((n//d)<Michael S. Branicky, Apr 05 2023

Formula

a(n) <= 2*n + 1.
a(n) <= 2^A070939(n) + n.
a(n) = Min_{d | n} A163621(n/d, d).

A322261 Square array T(n, k) (n >= 0, k >= 0) read by antidiagonals upwards: the lengths of runs in binary expansion of T(n, k) correspond to the lengths of runs in binary expansion of n followed by the lengths of runs in binary expansion of k.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 3, 5, 5, 3, 4, 6, 10, 4, 4, 5, 9, 13, 11, 11, 5, 6, 10, 18, 12, 20, 10, 6, 7, 13, 21, 19, 27, 21, 9, 7, 8, 14, 26, 20, 36, 26, 22, 8, 8, 9, 17, 29, 27, 43, 37, 25, 23, 23, 9, 10, 18, 34, 28, 52, 42, 38, 24, 40, 22, 10, 11, 21, 37, 35, 59, 53
Offset: 0

Views

Author

Rémy Sigrist, Dec 01 2018

Keywords

Comments

The array T is associative.

Examples

			Array T(n, k) begins (in decimal):
  n\k|  0   1   2   3   4   5   6   7    8    9   10   11   12
  ---+--------------------------------------------------------
    0|  0   1   2   3   4   5   6   7    8    9   10   11   12
    1|  1   2   5   4  11  10   9   8   23   22   21   20   19
    2|  2   5  10  11  20  21  22  23   40   41   42   43   44
    3|  3   6  13  12  27  26  25  24   55   54   53   52   51
    4|  4   9  18  19  36  37  38  39   72   73   74   75   76
    5|  5  10  21  20  43  42  41  40   87   86   85   84   83
    6|  6  13  26  27  52  53  54  55  104  105  106  107  108
    7|  7  14  29  28  59  58  57  56  119  118  117  116  115
    8|  8  17  34  35  68  69  70  71  136  137  138  139  140
Array T(n, k) begins (in binary):
  n\k |     0      1      10      11      100      101      110      111      1000
  ----+---------------------------------------------------------------------------
     0|     0      1      10      11      100      101      110      111      1000
     1|     1     10     101     100     1011     1010     1001     1000     10111
    10|    10    101    1010    1011    10100    10101    10110    10111    101000
    11|    11    110    1101    1100    11011    11010    11001    11000    110111
   100|   100   1001   10010   10011   100100   100101   100110   100111   1001000
   101|   101   1010   10101   10100   101011   101010   101001   101000   1010111
   110|   110   1101   11010   11011   110100   110101   110110   110111   1101000
   111|   111   1110   11101   11100   111011   111010   111001   111000   1110111
  1000|  1000  10001  100010  100011  1000100  1000101  1000110  1000111  10001000
		

Crossrefs

Programs

  • PARI
    torl(n) = my (r=[]); while (n, r = concat(valuation(n+(n%2),2), r); n \= 2^r[1];); r
    fromrl(r) = my (v=0); for (i=1, #r, v = (v + (i%2))*2^r[i]-(i%2)); v
    T(n,k) = fromrl(concat(torl(n), torl(k)))

Formula

T(n, 0) = T(0, n) = n.
T(n, 1) = A042963(n+1).
T(n, 2) = A047617(n+1).
T(n, 3) = A047457(n+1).
T(1, n) = A010078(n+1).
T(2, n) = A004757(n) for any n > 0.
A005811(T(n, k)) = A005811(n) + A005811(k).
T(2*n, k) = A163621(2*n, k) for any n > 0 and k > 0.
T(2*n, 2*n) = A020330(2*n) for any n > 0.
Showing 1-5 of 5 results.