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.

A298486 Square array T(n, k), n >= 0, k >= 0, read by antidiagonals upwards: T(n, k) = the (k+1)-th nonnegative number m such that n + m can be computed with carry in decimal base.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 1, 20, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 1
Offset: 0

Views

Author

Rémy Sigrist, Jan 20 2018

Keywords

Comments

The corresponding sequence for the binary base is A295653.

Examples

			Square array begins:
  n\k|  0   1   2   3   4   5   6   7   8   9   10  ...
  ---+-------------------------------------------------
    0|  0   1   2   3   4   5   6   7   8   9   10  ... <-- A001477
    1|  0   1   2   3   4   5   6   7   8  10   11  ...
    2|  0   1   2   3   4   5   6   7  10  11   12  ...
    3|  0   1   2   3   4   5   6  10  11  12   13  ...
    4|  0   1   2   3   4   5  10  11  12  13   14  ...
    5|  0   1   2   3   4  10  11  12  13  14   20  ...
    6|  0   1   2   3  10  11  12  13  20  21   22  ...
    7|  0   1   2  10  11  12  20  21  22  30   31  ...
    8|  0   1  10  11  20  21  30  31  40  41   50  ...
    9|  0  10  20  30  40  50  60  70  80  90  100  ... <-- A008592
   10|  0   1   2   3   4   5   6   7   8   9   10  ...
		

Crossrefs

Programs

  • PARI
    T(n,k,{base=10}) = my (v=0, p=1); while (k, my (r=base - (n%base)); v += p*(k%r); n \= base; k \= r; p *= base); v

Formula

For any n >= 0 and k >= 0:
- T(0, k) = k,
- T(9, k) = 10 * k,
- T(10^n - 1, k) = 10^n * k,
- T(n, 0) = 0,
- T(n, 1) = 10^A122840(n+1),
- T(n, k + A298372(n)) = k + 10^A004218(n+1) (i.e. each row is linear).

A352993 a(n) is the n-th positive integer that has no common 1-bit with n; a(0) = 0.

Original entry on oeis.org

0, 2, 4, 12, 8, 18, 24, 56, 16, 34, 36, 84, 48, 98, 112, 240, 32, 66, 68, 140, 72, 162, 168, 360, 96, 194, 196, 420, 224, 450, 480, 992, 64, 130, 132, 268, 136, 274, 280, 600, 144, 322, 324, 660, 336, 706, 720, 1488, 192, 386, 388, 780, 392, 834, 840, 1736
Offset: 0

Views

Author

Rémy Sigrist, Apr 14 2022

Keywords

Comments

This sequence corresponds to the main diagonal of A295653.
To compute a(n):
- consider the binary expansion of n: Sum_{k >= 0} b_k * 2^k,
- and the positions of zeros in this binary expansion: {z_k, k >= 0},
- then a(n) = Sum_{k >= 0} b_k * 2^z(k).

Examples

			For n = 43:
- the binary expansion of 43 is       "... 0 0 0 0 1 0 1 0 1 1"
- so the binary expansion of a(43) is "... 1 0 1 0(0)1(0)1(0 0)",
- and a(43) = 660.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (m=n, v=0); for (e=0, oo, if (n==0, return (v), !bittest(m, e), if (n%2, v+=2^e;); n\=2)) }
    
  • Python
    def a(n):
        b = bin(n)[2:][::-1]
        z = [k for k, bk in enumerate(b+'0'*(len(b)-b.count('0'))) if bk=='0']
        return sum(int(bk)*2**zk for bk, zk in zip(b, z))
    print([a(n) for n in range(56)]) # Michael S. Branicky, Apr 21 2022

Formula

a(n) = A295653(n, n).
a(2^k) = 2^(k+1) for any k >= 0.
a(2^k-1) = A020522(k) for any k >= 0.
A000120(a(n)) = A000120(n).
A070939(a(n)) = A070939(n) + A000120(n).
Showing 1-2 of 2 results.