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.

A342261 Irregular triangular array T(n,k) = m read by rows. Row n lists all solutions m < 3^n, where A340407(3^n*j - m) = n is true for all j > 0, sorted in ascending order.

Original entry on oeis.org

0, 1, 8, 2, 4, 5, 16, 13, 14, 22, 34, 38, 52, 74, 77, 20, 25, 40, 50, 88, 130, 146, 173, 185, 203, 209, 223, 229, 230, 238, 241, 130, 146, 173, 185, 203, 209, 223, 229, 230, 238, 241, 41, 61, 76, 104, 106, 121, 128, 157, 254, 266, 292, 311, 403, 412, 430, 445, 454, 493
Offset: 1

Views

Author

Thomas Scheuerle, Mar 26 2021

Keywords

Comments

Each row n has 2^(n-1) values.
In all rows other than the first row of T(n,k), there are exactly 2^(n-2) numbers of the form 3*p + 1 and the same number of numbers of the form 3*q - 1.
Each integer has a unique representation of the form 3^n*j - T(n,k).

Examples

			Triangle T(n,k) begins:
  0;
  1,   8;
  2,   4,  5, 16;
  13, 14, 22, 34, 38, 52, 74, 77;
		

Crossrefs

Cf. A340407.

Programs

  • MATLAB
    function t = A342261 (max_row)
        maxtest = 10;
        d = A340407(maxtest*3^max_row);
        for row = 1:max_row
            m = 0;
            for k = 1:2^(row-1)
                test = d((1:maxtest)*(3^row)-m);
                while ~all(test == test(1))||(test(1) ~= row)
                    m = m+1;
                    test = d((1:maxtest)*(3^row)-m);
                end
                t(row,k) = m;
                t = t+1;
            end
        end
    end
    function d = A340407 (max_p)
        for p = 1:max_p
            s = 6*p -2;
            c = 0;
            while mod(s,3) ~= 0
                s = A342369( s );
               if mod(s,3) == 2
                    c = c+1;
                end
            end
            d(p) = c;
        end
    end
    function b = A342369( n )
        if mod(n,3) == 2
            b = (2*n - 1)/3;
        else
            b = 2*n;
        end
    end