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.

A316585 Number of ways to stack n triangles symmetrically (pointing upwards or downwards depending on row parity).

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 6, 7, 12, 12, 21, 23, 39, 43, 74, 81, 138, 151, 257, 281, 479, 525, 895, 981, 1671, 1830, 3116, 3414, 5813, 6370, 10847, 11887, 20239, 22177, 37758, 41375, 70442, 77193, 131425, 144020, 245197, 268693, 457451, 501288, 853446, 935235, 1592242, 1744834, 2970580, 3255261
Offset: 0

Views

Author

Seiichi Manyama, Jul 07 2018

Keywords

Examples

			a(9) = 12.
    *   *   *   *   *   *   *   *   *
   / \ / \ / \ / \ / \ / \ / \ / \ / \
  *---*---*---*---*---*---*---*---*---*
.
    *   *   *   *---*   *   *   *
   / \ / \ / \ / \ / \ / \ / \ / \
  *---*---*---*---*---*---*---*---*
.
    *   *   *---*---*   *   *
   / \ / \ / \ / \ / \ / \ / \
  *---*---*---*---*---*---*---*
.
    *   *---*   *   *---*   *
   / \ / \ / \ / \ / \ / \ / \
  *---*---*---*---*---*---*---*
.
    *---*   *   *   *   *---*
   / \ / \ / \ / \ / \ / \ / \
  *---*---*---*---*---*---*---*
.
    *   *---*---*---*   *
   / \ / \ / \ / \ / \ / \
  *---*---*---*---*---*---*
.
    *---*   *---*   *---*
   / \ / \ / \ / \ / \ / \
  *---*---*---*---*---*---*
.
    *---*---*---*---*
   / \ / \ / \ / \ / \
  *---*---*---*---*---*
.
          *   *
         / \ / \
    *   *---*---*   *
   / \ / \ / \ / \ / \
  *---*---*---*---*---*
.
      *           *
     / \         / \
    *---*   *   *---*
   / \ / \ / \ / \ / \
  *---*---*---*---*---*
.
      *       *
     / \     / \
    *---*---*---*
   / \ / \ / \ / \
  *---*---*---*---*
.
        *
       / \
      *---*
     / \ / \
    *---*---*
   / \ / \ / \
  *---*---*---*
.
		

Crossrefs

Programs

  • Maple
    Motzk := proc(x,y,twoar)
        option remember;
        if x =0 then
            if y <> 0 or twoar <>0 then
                return 0;
            else
                return 1;
            end if;
        elif y < 0 or y > x or twoar A316585 := proc(twoar)
        local a,x,y ;
        a:= 0 ;
        for x from 0 to twoar do
        for y from 0 to x do
            a := a+Motzk(x,y,twoar) ;
        end do:
        end do:
        a ;
    end proc:
    seq(A316585(n),n=0..50) ; # R. J. Mathar, Aug 23 2018
  • Mathematica
    Motzk[x_, y_, twoar_] := Motzk[x, y, twoar] = Which[
    x == 0, If[y != 0 || twoar != 0, 0, 1],
    y < 0 || y > x || twoar < x, 0,
    y == 0 , If[Mod[x, 2] == 0, Motzk[x - 1, y + 1, twoar - 2y - 1], 0],
    Mod[y, 2] == Mod[x, 2], Motzk[x - 1, y + 1, twoar - 2y - 1] + Motzk[x - 1, y, twoar - 2y] + Motzk[x - 1, y - 1, twoar - 2y + 1],
    True, Motzk[x - 1, y, twoar - 2y]];
    A316585[twoar_] := Module[{a, x, y}, a = 0; For[x = 0, x <= twoar , x++, For[y = 0, y <= x, y++, a = a + Motzk[x, y, twoar]]]; a];
    Table[A316585[n], {n, 0, 50}] (* Jean-François Alcover, Nov 08 2023, after R. J. Mathar *)

Extensions

a(36)-a(50) from R. J. Mathar, Aug 23 2018