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.

User: Sophia Pi

Sophia Pi's wiki page.

Sophia Pi has authored 2 sequences.

A367055 Triangle read by rows: T(n, k) = A000120(n) + A000120(k), 0 <= k <= n.

Original entry on oeis.org

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

Author

Mithra Karamchedu and Sophia Pi, Nov 03 2023

Keywords

Comments

T(n, k) is the sum of the Hamming weight of n and the Hamming weight of k.
See A365618 for a table read by antidiagonals.

Examples

			Triangle begins:
      k=0  1  2  3  4  5
  n=0:  0;
  n=1:  1, 2;
  n=2:  1, 2, 2;
  n=3:  2, 3, 3, 4;
  n=4:  1, 2, 2, 3, 2;
  n=5:  2, 3, 3, 4, 3, 4;
        ...
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := DigitCount[n, 2, 1] + DigitCount[k, 2, 1]
  • Python
    from math import comb, isqrt
    def A367055(n): return (n-comb(r:=(m:=isqrt(k:=n+1<<1))+(k>m*(m+1)),2)).bit_count()+(r-1).bit_count() # Chai Wah Wu, Nov 11 2024

Formula

T(n, k) = A000120(n) + A000120(k).

A365618 Table read by antidiagonals: T(n, k) = A000120(n) + A000120(k).

Original entry on oeis.org

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

Author

Mithra Karamchedu and Sophia Pi, Nov 03 2023

Keywords

Comments

T(n, k) is the sum of the Hamming weight of n and the Hamming weight of k.
Picking all points (n, k) such that T(n, k) <= N for some natural number N iteratively generates a Sierpinski-like fractal H. To generate the fractal, fix i and produce the set H_i = {(x, y) in [0, 1)^2 : T(floor(x * 2^i), floor(y * 2^i)) <= i}. Then, define the "limit fractal" H = {(x, y) in [0, 1)^2 : there exists N such that (x, y) is in H_i for all i >= N}.
The table is symmetric, T(n, k) = T(k, n).
See A367055 for a triangle read by rows.

Examples

			The table begins:
      k=0 1 2 3 4
  n=0:  0 1 1 2 1 ...
  n=1:  1 2 2 3 2 ...
  n=2:  1 2 2 3 2 ...
  n=3:  2 3 3 4 3 ...
  n=4:  1 2 2 3 2 ...
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := DigitCount[n, 2, 1] + DigitCount[k, 2, 1]

Formula

T(n, k) = A000120(n) + A000120(k).
If n_1 and n_2 share no 1 bits in common, then T(n_1 + n_2, k) = A000120(n_1) + A000120(n_2) + A000120(k).