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.

A062896 Number of addition triangles with apex n (version 2).

Original entry on oeis.org

1, 2, 2, 4, 4, 7, 7, 12, 12, 18, 19, 27, 28, 39, 41, 54, 58, 74, 78, 99, 106, 129, 139, 168, 179, 214, 229, 268, 289, 335, 357, 414, 443, 504, 540, 612, 653, 737, 786, 878, 938, 1045, 1111, 1234, 1313, 1444, 1539, 1692, 1795, 1965, 2082, 2273, 2414
Offset: 1

Views

Author

Naohiro Nomoto, Feb 11 2002

Keywords

Comments

An addition triangle has any set of positive numbers as base; other rows are formed by adding pairs of adjacent numbers.
Reversing the base does not count as a different triangle.

Examples

			For n = 5:
    5
   2,3     5     5
  1,1,2   4,1   2,3   5.
with four different bases, so a(5) = 4.
		

Crossrefs

See A062684 for version 1 (counts reversals).
Equivalent sequences with restrictions on rows: A337765 (weakly increasing), A337766 (strongly increasing).
Equivalent sequence where n is the sum of all numbers in the triangle: A337787.

Extensions

Extended and edited by John W. Layman, Feb 14 2002

A337765 Number of addition triangles with apex n where all rows are weakly increasing.

Original entry on oeis.org

1, 2, 2, 4, 4, 5, 6, 9, 9, 11, 12, 15, 16, 18, 20, 26, 27, 29, 32, 37, 39, 43, 47, 53, 55, 60, 65, 72, 75, 80, 88, 99, 102, 108, 114, 125, 132, 141, 148, 159, 166, 176, 187, 200, 206, 218, 232, 249, 257, 268, 282, 301, 313, 327, 340, 360, 374, 393, 410, 429, 444, 465, 487, 516, 530, 550
Offset: 1

Views

Author

Seiichi Manyama, Sep 19 2020

Keywords

Comments

An addition triangle has any set of positive numbers as base; other rows are formed by adding pairs of adjacent numbers.
If the bottom row are weakly increasing, then every rows are weakly increasing.
5
2<=3
1<=1<=2

Examples

			For n = 5:
    5
   2,3     5     5
  1,1,2   1,4   2,3   5
For n = 6:
    6
   2,4     6     6     6
  1,1,3   1,5   2,4   3,3   6
For n = 7:
    7       7
   2,5     3,4     7     7     7
  1,1,4   1,2,2   1,6   2,5   3,4   7
For n = 8:
     8
    4,4       8       8       8
   2,2,2,    2,6     3,5     4,4     8     8     8     8
  1,1,1,1   1,1,5   1,2,3   2,2,2   1,7   2,6   3,5   4,4   8
For n = 9:
     9
    4,5       9       9       9
   2,2,3,    2,7     3,6     4,5     9     9     9     9
  1,1,1,2   1,1,6   1,2,4   2,2,3   1,8   2,7   3,6   4,5   9
		

Crossrefs

Programs

  • Ruby
    def A(n)
      f_ary = [[n]]
      cnt = 1
      while f_ary.size > 0
        b_ary = []
        f_ary.each{|i|
          s = i.size
          (1..i[0] - 1).each{|j|
            a = [j]
            (0..s - 1).each{|k|
              num = i[k] - a[k]
              if num > 0
                a << num
              else
                break
              end
            }
            b_ary << a if a.size == s + 1 && a == a.sort
          }
        }
        f_ary = b_ary
        cnt += f_ary.size
      end
      cnt
    end
    def A337765(n)
      (1..n).map{|i| A(i)}
    end
    p A337765(50)

A346523 Number of sum pyramids for n.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 3, 5, 5, 7, 9, 11, 11, 18, 17, 22, 23, 29, 31, 38, 37, 46, 49, 58, 59, 72, 76, 86, 90, 106, 115, 131, 140, 159, 177, 189, 204, 236, 254, 274, 292, 328, 355, 398, 404, 455, 485, 518, 555, 622, 647, 698, 727, 808, 837, 922, 939, 1032, 1100
Offset: 1

Views

Author

J. Stauduhar, Jul 21 2021

Keywords

Comments

A sum pyramid for n is defined to be a pyramid with n at its apex, all pairs of adjacent members (x, y) of rows 2,3,4,... sum to the element immediately above, every element is positive and distinct, rows are complete (length of row m = length of row (m-1) + 1), reflections are not counted, and the pyramid is maximal (i.e., not part of a larger pyramid that qualifies). An example of the meaning of "maximal" can be seen in the Example section: the pyramids
.
9 9
6 3 and 5 4
.
are not counted because they consist of the top 2 rows of larger (3-row) pyramids that are counted. [Clarified by Peter Munn, Nov 20 2021]

Examples

			The five pyramids for a(9) are:
                9       9       9
   9     9     6 3     6 3     5 4
  8 1   7 2   5 1 2   4 2 1   2 3 1
		

Crossrefs

Cf. A028307 (record pyramid heights), A337766, A348850.

Programs

  • Python
    See Links section.

Extensions

Definition aligned with A028307 by Peter Munn, Nov 20 2021

A337785 Number of addition triangles whose sum is n (version 1).

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 2, 6, 1, 9, 1, 9, 4, 9, 3, 14, 2, 14, 6, 14, 5, 21, 4, 19, 10, 21, 8, 27, 6, 29, 16, 25, 12, 38, 14, 33, 19, 37, 22, 46, 14, 47, 33, 45, 22, 59, 29, 59, 35, 56, 40, 74, 34, 68, 53, 72, 47, 90, 47, 88, 63, 88, 64, 105, 59, 108, 84, 106, 75, 130, 81, 125, 99, 128, 103, 147
Offset: 1

Views

Author

Seiichi Manyama, Sep 21 2020

Keywords

Comments

An addition triangle has any set of positive numbers as base; other rows are formed by adding pairs of adjacent numbers.
Reversing the base counts as a different triangle.

Examples

			   n |
-----+------------------------------------------------
   1 |  1
-----+------------------------------------------------
   2 |  2
-----+------------------------------------------------
   3 |  3
-----+------------------------------------------------
   4 |      2
     |  4  1,1
-----+------------------------------------------------
   5 |  5
-----+------------------------------------------------
   6 |      3    3
     |  6  1,2  2,1
-----+------------------------------------------------
   7 |  7
-----+------------------------------------------------
   8 |      4    4    4
     |  8  1,3  2,2  3,1
-----+------------------------------------------------
   9 |  9
-----+------------------------------------------------
  10 |      5    5    5    5
     | 10  1,4  2,3  3,2  4,1
-----+------------------------------------------------
  11 |       4
     |      2,2
     | 11  1,1,1
-----+------------------------------------------------
  12 |      6    6    6    6    6
     | 12  1,5  2,4  3,3  4,2  5,1
-----+------------------------------------------------
  13 | 13
-----+------------------------------------------------
  14 |                                     5      5
     |      7    7    7    7    7    7    2,3    3,2
     | 14  1,6  2,5  3,4  4,3  5,2  6,1  1,1,2  2,1,1
		

Crossrefs

Cf. A014430, A062684, A062896, A337765, A337766, see A337787 for version 2.

Programs

  • Ruby
    def f(n)
      ary = [1]
      (n - 1).times{|i|
        ary = [0] + ary + [0]
        ary = (0..i + 1).map{|j| ary[j] + ary[j + 1] + 1}
      }
      ary
    end
    def A(n)
      f_ary = (1..n / 2).map{|i| [i]}
      cnt = 1
      s = 1
      while f_ary.size > 0
        s_ary = f(s + 1)
        b_ary = []
        f_ary.each{|i|
          (1..i[0] - 1).each{|j|
            a = [j]
            (0..s - 1).each{|k|
              num = i[k] - a[k]
              if num > 0
                a << num
              else
                break
              end
            }
            if a.size == s + 1
              sum = (0..s).inject(0){|t, m| t + s_ary[m] * a[m]}
              if sum < n
                b_ary << a
              elsif sum == n
                cnt += 1
              end
            end
          }
        }
        f_ary = b_ary
        s += 1
      end
      cnt
    end
    def A337785(n)
      (1..n).map{|i| A(i)}
    end
    p A337785(50)
Showing 1-4 of 4 results.