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.

A293578 Triangular array read by rows. One form of sieve of Eratosthenes (see comments for construction).

Original entry on oeis.org

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

Views

Author

Luc Rousseau, Oct 12 2017

Keywords

Comments

Construction: row n >= 1 contains 2n-1 values indexed from t=-(n-1) to t=+(n-1). Initialize all values to 0. For all positive integers n and all nonnegative integers u, set the value at coordinates (n, -(n-1)) + u*(n,1) to (n + u).
Each nonzero value in row n corresponds to a way of writing n as a product of two positive integers (see formulas). Each row starts with a nonzero value and ends with a nonzero value. A number n is a prime iff row n contains exactly two nonzero values.

Examples

			Array begins (zeros replaced by dots):
                  1
                2 . 2
              3 . . . 3
            4 . . 3 . . 4
          5 . . . . . . . 5
        6 . . . 4 . 4 . . . 6
      7 . . . . . . . . . . . 7
    8 . . . . 5 . . . 5 . . . . 8
  9 . . . . . . . 5 . . . . . . . 9
		

Crossrefs

Cf. A288969.

Programs

  • Mathematica
    F[n_, t_] :=
      Module[{x}, x = Floor[(-t + Sqrt[t^2 + 4 n])/2]; n - x (t + x)];
    T[n_, t_] := F[n - 1, t] - F[n, t] + 1;
    ARow[n_] := Table[T[n, t], {t, -(n - 1), +(n - 1)}];
    Table[ARow[n], {n, 1, 10}] // Flatten

Formula

If z is a nonzero value at coordinates (n,t) then
n = k*(k+t) where k is a positive integer solution of k^2 + tk - n = 0;
Moreover:
z = n/k + k - 1;
n = ((z+1)^2 - t^2)/4.

A293497 Triangular array read by rows: row n >= 1 is the list of integers from 0 to 2n-1.

Original entry on oeis.org

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

Views

Author

Luc Rousseau, Oct 10 2017

Keywords

Comments

a(n) = the least nonnegative n - 2 * T, where T is a triangular number.
a(n) = the least nonnegative n - k * (k + 1), where k is a nonnegative integer.
This sequence shares several properties with A053186 (square excess of n):
- same recursion formula a(n) = f(n,1) with f(n,m) = if n < m then n, otherwise f(n-m,m+2);
- same formula pattern a(n) = n - g(floor(f(n))), with f and g each other's inverse function: f(x)=sqrt(x) and g(x)=x^2 in the case of A053186, f(x)=(sqrt(1+4x)-1)/2 and g(x)=x(x+1) in the case of this sequence;
- similar graphic representation (arithmetically increasing sawtooth shape);
- both sequences appear to intertwine into A288969.
Odd-indexed rows of A002262. - Omar E. Pol, Oct 10 2017

Examples

			Triangle begins:
0, 1;
0, 1, 2, 3;
0, 1, 2, 3, 4, 5;
0, 1, 2, 3, 4, 5, 6, 7;
0, 1, 2, 3, 4, 5, 6, 7, 8, 9;
...
		

Crossrefs

Programs

  • Mathematica
    FOdd[x_] := x*(x + 1)
    InvFOdd[x_] := (Sqrt[1 + 4 x] - 1)/2
    GOdd[n_] := n - FOdd[Floor[InvFOdd[n]]]
    Table[GOdd[n], {n, 0, 80}]

Formula

a(n) = n - g(floor(f(n))), with f(x) = (sqrt(1+4x)-1)/2 and g(x) = x(x+1).
a(n) = f(n,1) with f(n,m) = if n < m then n, otherwise f(n-m,m+2).
a(n) = t - t^2 + n, where t = floor(sqrt(n+1) + 1/2). - Ridouane Oudra, May 03 2019
Showing 1-2 of 2 results.