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-4 of 4 results.

A360229 Row sums of triangle A360173.

Original entry on oeis.org

0, 1, 3, 6, 16, 36, 73, 156, 324, 677, 1405, 2864, 5906, 12058, 24548, 49928, 101434, 206173, 417141, 844256, 1707622, 3452998, 6970196, 14058528, 28368774, 57197983, 115239846, 232020596, 467296470, 940684267, 1892396396, 3805806218, 7654402454, 15391563411
Offset: 0

Views

Author

John Tyler Rascoe, Jan 30 2023

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1, (p->
           add((t-> `if`(i
          add(i*coeff(p, x, i), i=0..degree(p)))(b(n))
        end:
    seq(a(n), n=0..35);  # Alois P. Heinz, Jan 30 2023
  • Mathematica
    b[n_] := b[n] = If[n == 0, 1, Function[p, Sum[Function[t, If[iJean-François Alcover, Apr 24 2025, after Alois P. Heinz *)

A365968 Irregular triangle read by rows: T(n,k) (0 <= n, 0 <= k < 2^n). An infinite binary tree with root node 0 in row n = 0. Each node then has left child (2*j) - k - 1 and right child (2*j) - k + 1, where j and k are the values of the parent and grandparent nodes respectively.

Original entry on oeis.org

0, -1, 1, -3, -1, 1, 3, -6, -4, -2, 0, 0, 2, 4, 6, -10, -8, -6, -4, -4, -2, 0, 2, -2, 0, 2, 4, 4, 6, 8, 10, -15, -13, -11, -9, -9, -7, -5, -3, -7, -5, -3, -1, -1, 1, 3, 5, -5, -3, -1, 1, 1, 3, 5, 7, 3, 5, 7, 9, 9, 11, 13, 15, -21, -19, -17, -15, -15, -13, -11, -9
Offset: 0

Views

Author

John Tyler Rascoe, Sep 23 2023

Keywords

Comments

For n in A014601 row n will contain all even numbers from 0 to A000217(n).
For n in A042963 row n will contain all odd numbers from 1 to A000217(n).

Examples

			Triangle begins:
        k=0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
  n=0:    0;
  n=1:   -1,  1;
  n=2:   -3, -1,  1,  3;
  n=3:   -6, -4, -2,  0,  0,  2,  4,  6;
  n=4:  -10, -8, -6, -4, -4, -2,  0,  2, -2,  0,  2,  4,  4,  6,  8, 10;
  ...
The binary tree starts with root 0 in row n = 0. For rows n < 2, k = 0.
In row n = 3, the parent node -3 has left child -6 = 2*(-3) - (-1) - 1.
The tree begins:
row
[n]
[0]                   ______0______
                     /             \
[1]              __-1__           __1__
                /      \         /     \
[2]           -3       -1       1       3
              / \      / \     / \     / \
[3]         -6  -4   -2   0   0   2   4   6
.
		

Crossrefs

Programs

  • PARI
    T(n,k) = sum(i=0,n-1, if(bittest(k,i), i+1, -(i+1))); \\ Kevin Ryde, Nov 14 2023
  • Python
    def A365968(n, k):
        b, x = bin(k)[2:].zfill(n), 0
        for i in range(0, n):
            x += (-1)**(int(b[n-(i+1)])+1)*(i+1)
        return(x) # John Tyler Rascoe, Nov 12 2023
    

Formula

T(n,k) = - Sum_{i=0..n-1} (i+1)*(-1)^b[i] where the binary expansion of k is k = Sum_{i=0..n-1} b[i]*2^i. - Kevin Ryde, Nov 14 2023

A360298 Irregular triangle (an infinite binary tree) read by rows. The tree has root node 1 in row n = 1. For n > 1, each node with value m in row n-1 has a left child with value m / n if n divides m, and a right child with value m * n.

Original entry on oeis.org

1, 2, 6, 24, 120, 20, 720, 140, 5040, 1120, 630, 40320, 10080, 70, 5670, 4480, 362880, 1008, 100800, 7, 700, 567, 56700, 448, 44800, 36288, 3628800, 11088, 1108800, 77, 7700, 6237, 623700, 4928, 492800, 399168, 39916800, 924, 133056, 92400, 13305600, 924, 92400, 74844, 51975, 7484400, 59136, 5913600, 33264, 4790016, 3326400, 479001600
Offset: 1

Views

Author

Rémy Sigrist, Feb 02 2023

Keywords

Comments

This sequence is a variant of A360173; here we use divisions and multiplications, there subtractions and additions.
The n-th row has A360299(n) terms, starts with A008336(n+1) and ends with A000142(n).

Examples

			The tree begins:
  n     n-th row
  --    --------
   1    1___
            |
   2        2___
                |
   3            6___
                    |
   4               24___
                        |
   5      _____________120_____________
         |                             |
   6    20___                         720___
             |                              |
   7        140___                   _____5040_____
                  |                 |              |
   8            1120__           __630__       __40320__
                      |         |       |     |         |
   9                10080      70     5670  4480     362880
		

Crossrefs

Cf. A000142, A008336, A360173, A360299 (row lengths), A360300.

Programs

  • PARI
    row(n) = { my (r = [1]); for (h = 2, n, r=concat(apply(v -> if (v%h==0, [v/h, v*h], [v*h]), r))); return (r) }
    
  • Python
    from functools import cache
    @cache
    def row(n):
        if n == 1: return [1]
        out = []
        for r in row(n-1): out += ([r//n] if r%n == 0 else []) + [r*n]
        return out
    print([an for r in range(1, 13) for an in row(r)]) # Michael S. Branicky, Feb 02 2023

Formula

T(n, 1) = A008336(n+1).
T(n, A360299(n)) = A000142(n).
T(p, k) = p * T(p-1, k) for any prime number p.

A360255 Irregular triangle (an infinite binary tree) read by rows: see Comments section for definition.

Original entry on oeis.org

0, 1, 3, 6, 2, 10, 7, 5, 15, 13, 11, 9, 21, 20, 4, 18, 2, 16, 14, 28, 12, 28, 12, 26, 8, 24, 22, 20, 36, 21, 19, 37, 21, 17, 35, 17, 33, 13, 31, 11, 29, 27, 45, 11, 31, 9, 29, 27, 47, 31, 7, 27, 25, 45, 7, 27, 23, 43, 23, 41, 19, 39, 17, 37, 35, 55, 22, 42, 18
Offset: 0

Views

Author

John Tyler Rascoe, Jan 30 2023

Keywords

Comments

The binary tree has root node 0, in row n=0. The left child is m - n and the right child is m + n, where m is the parent node and n is the row of the child. A given node will only have a child if the child is nonnegative and the value of the child is not present in the path from the parent to the root, including the root value itself.
The n-th row will have A321535(n) nodes. The rightmost border is A000217.

Examples

			The binary tree starts with root 0 in row n = 0. In row n = 3, the parent node m = 3 does not have a left child since 3 - 3 = 0 is included in the path from the parent to the root {3,1,0}.
The tree begins:
row
[n]
[0]           0
               \
[1]             1
                 \
[2]               3
                   \
[3]               __6__
                 /     \
[4]             2      10
                 \    /  \
[5]               7  5    15
		

Crossrefs

Programs

  • MATLAB
    function a = A360255( max_row )
        p = 0; a = 0; pos = 1;
        for n = 1:max_row
            for k = pos:length(a)
                h =[]; o = p(k);
                while o > 0
                    h = [h a(o)]; o = p(o);
                end
                if a(k)-n > 0
                    if isempty(find(h == a(k)-n, 1))
                        p = [p k]; a = [a a(k)-n];
                    end
                end
                if isempty(find(h == a(k)+n, 1))
                    p = [p k]; a = [a a(k)+n];
                end
            end
            pos = k+1;
        end
    end % Thomas Scheuerle, Jan 31 2023
Showing 1-4 of 4 results.