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.

A301983 Irregular triangle read by rows T(n, k), n >= 1 and 1 <= k <= A301977(n): T(n, k) is the k-th positive number whose binary digits appear in order but not necessarily as consecutive digits in the binary representation of n.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 30 2018

Keywords

Comments

This sequence has similarities with A119709 and A165416; there we consider consecutive digits, here not.

Examples

			Triangle begins:
   1:    [1]
   2:    [1, 2]
   3:    [1, 3]
   4:    [1, 2, 4]
   5:    [1, 2, 3, 5]
   6:    [1, 2, 3, 6]
   7:    [1, 3, 7]
   8:    [1, 2, 4, 8]
   9:    [1, 2, 3, 4, 5, 9]
  10:    [1, 2, 3, 4, 5, 6, 10]
  11:    [1, 2, 3, 5, 7, 11]
  12:    [1, 2, 3, 4, 6, 12]
  13:    [1, 2, 3, 5, 6, 7, 13]
  14:    [1, 2, 3, 6, 7, 14]
  15:    [1, 3, 7, 15]
  16:    [1, 2, 4, 8, 16]
		

Crossrefs

Cf. A119709, A165416, A301977 (row length).

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, {0},
          map(x-> [x, 2*x+r][], b(iquo(n, 2, 'r'))))
        end:
    T:= n-> sort([(b(n) minus {0})[]])[]:
    seq(T(n), n=1..20);  # Alois P. Heinz, Jan 26 2022
  • PARI
    T(n,k) = my (b=binary(n), s=Set(1)); for (i=2, #b, s = setunion(s, Set(apply(v -> 2*v+b[i], s)))); return (s[k])

Formula

T(n, 1) = 1.
T(n, A301977(n)) = n.
T(2^n, k) = 2^(k-1) for any n > 0 and k = 1..n+1.
T(2^n - 1, k) = 2^k - 1 for any n > 0 and k = 1..n.

A301984 a(n) is the greatest positive number k such that the binary digits of any number in the interval 1..k appear in order but not necessarily as consecutive digits in the binary representation of n.

Original entry on oeis.org

1, 2, 1, 2, 3, 3, 1, 2, 5, 6, 3, 4, 3, 3, 1, 2, 5, 6, 5, 6, 7, 7, 3, 4, 7, 7, 3, 4, 3, 3, 1, 2, 5, 6, 5, 6, 11, 11, 5, 6, 13, 14, 7, 8, 7, 7, 3, 4, 9, 10, 7, 8, 7, 7, 3, 4, 7, 7, 3, 4, 3, 3, 1, 2, 5, 6, 5, 6, 11, 11, 5, 6, 13, 14, 11, 12, 11, 11, 5, 6, 13, 14
Offset: 1

Views

Author

Rémy Sigrist, Mar 30 2018

Keywords

Comments

Equivalently, a(n) is the greatest positive number k such that A301983(n, k) = k.
Apparently, the k-th record value is A089633(k), and the first term with this value has index A048678(A089633(k)).

Examples

			The 13th row of A301983 is: 1, 2, 3, 5, 6, 7, 13; all numbers in the range 1..3 appear in this row, but the number 4 is missing; hence a(13) = 3.
		

Crossrefs

Programs

  • PARI
    a(n) = my (b=binary(n), s=Set(1)); for (i=2, #b, s = setunion(s, Set(apply(v -> 2*v+b[i], s)))); for (u=1, oo, if (!setsearch(s,u), return (u-1)))

Formula

a(n) <= A301977(n).
a(2*n) >= a(n).
a(2*n + 1) >= a(n) (with strict inequality if a(n) is even).
a(n) = 1 iff n is positive and belongs to A000225.

A360296 a(1) = 1, and for any n > 1, a(n) is the sum of the terms of the sequence at indices k < n whose binary digits appear in order but not necessarily as consecutive digits in the binary representation of n.

Original entry on oeis.org

1, 1, 1, 2, 3, 3, 2, 4, 8, 11, 8, 8, 11, 8, 4, 8, 20, 34, 26, 34, 51, 40, 20, 20, 40, 51, 34, 26, 34, 20, 8, 16, 48, 96, 76, 118, 186, 152, 76, 96, 208, 281, 186, 152, 208, 124, 48, 48, 124, 208, 152, 186, 281, 208, 96, 76, 152, 186, 118, 76, 96, 48, 16, 32
Offset: 1

Views

Author

Rémy Sigrist, Feb 02 2023

Keywords

Comments

This sequence is a variant of A165418.

Examples

			The first terms, alongside the corresponding k's, are:
  n   a(n)  k's
  --  ----  ------------------
   1     1  N/A
   2     1  {1}
   3     1  {1}
   4     2  {1, 2}
   5     3  {1, 2, 3}
   6     3  {1, 2, 3}
   7     2  {1, 3}
   8     4  {1, 2, 4}
   9     8  {1, 2, 3, 4, 5}
  10    11  {1, 2, 3, 4, 5, 6}
  11     8  {1, 2, 3, 5, 7}
  12     8  {1, 2, 3, 4, 6}
  13    11  {1, 2, 3, 5, 6, 7}
  14     8  {1, 2, 3, 6, 7}
  15     4  {1, 3, 7}
  16     8  {1, 2, 4, 8}
		

Crossrefs

Programs

  • PARI
    { for (n=1, #a=vector(64), print1 (a[n]=if (n==1, 1, s = [1]; b = binary(n); for (k=2, #b, s = setunion(s, apply(v -> 2*v+b[k], s))); sum(k=1, #s-1, a[s[k]]);)", ")) }

Formula

a(n) = Sum_{k = 1..A301977(n-1)} a(A301983(n, k)) for any n > 1.
a(2^k) = 2^(k-1) for any k > 0.
a(2^k-1) = 2^(k-2) for any k > 1.
a(n) >= A165418(n).
Showing 1-3 of 3 results.