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.

A126155 Symmetric triangle, read by rows of 2*n+1 terms, similar to triangle A008301. Second term 5 times first term.

Original entry on oeis.org

1, 1, 5, 1, 7, 35, 55, 35, 7, 139, 695, 1195, 1415, 1195, 695, 139, 5473, 27365, 48145, 63365, 69025, 63365, 48145, 27365, 5473, 357721, 1788605, 3175705, 4343885, 5126905, 5403005, 5126905, 4343885, 3175705, 1788605, 357721
Offset: 0

Views

Author

Paul D. Hanna, Dec 20 2006

Keywords

Examples

			The triangle begins:
  1;
  1, 5, 1;
  7, 35, 55, 35, 7;
  139, 695, 1195, 1415, 1195, 695, 139;
  5473, 27365, 48145, 63365, 69025, 63365, 48145, 27365, 5473;
  357721, 1788605, 3175705, 4343885, 5126905, 5403005, 5126905, 4343885, 3175705, 1788605, 357721; ...
If we write the triangle like this:
  .......................... ....1;
  ................... ....1, ....5, ....1;
  ............ ....7, ...35, ...55, ...35, ....7;
  ..... ..139, ..695, .1195, .1415, .1195, ..695, ..139;
  .5473, 27365, 48145, 63365, 69025, 63365, 48145, 27365, .5473;
then the first term in each row is the sum of the previous row:
  5473 = 139 + 695 + 1195 + 1415 + 1195 + 695 + 139
the next term is 5 times the first:
  27365 = 5*5473,
and the remaining terms in each row are obtained by the rule illustrated by:
  48145 = 2*27365 - 5473 - 8*139;
  63365 = 2*48145 - 27365 - 8*695;
  69025 = 2*63365 - 48145 - 8*1195;
  63365 = 2*69025 - 63365 - 8*1415;
  48145 = 2*63365 - 69025 - 8*1195;
  27365 = 2*48145 - 63365 - 8*695;
  5473 = 2*27365 - 48145 - 8*139.
An alternate recurrence is illustrated by:
  27365 = 5473 + 4*(139 + 695 + 1195 + 1415 + 1195 + 695 + 139);
  48145 = 27365 + 4*(695 + 1195 + 1415 + 1195 + 695);
  63365 = 48145 + 4*(1195 + 1415 + 1195);
  69025 = 63365 + 4*(1415);
and then for k>n, T(n,k) = T(n,2n-k).
		

Crossrefs

Cf. A126156 (column 0); diagonals: A126157, A126158; A126159; variants: A008301 (p=1), A125053 (p=2), A126150 (p=3).

Programs

  • Maple
    T := proc(n,k) option remember; local j;
      if n = 1 then 1
    elif k = 1 then add(T(n-1, j), j=1..2*n-3)
    elif k = 2 then 5*T(n, 1)
    elif k > n then T(n, 2*n-k)
    else 2*T(n, k-1)-T(n, k-2)-8*T(n-1, k-2)
      fi end:
    seq(print(seq(T(n,k), k=1..2*n-1)), n=1..6); # Peter Luschny, May 12 2014
  • Mathematica
    T[n_, k_] := T[n, k] = Which[n==1, 1, k==1, Sum[T[n-1, j], {j, 1, 2n-3}], k==2, 5 T[n, 1], k>n, T[n, 2n-k], True, 2 T[n, k-1] - T[n, k-2] - 8 T[n-1, k-2]];
    Table[T[n, k], {n, 1, 6}, {k, 1, 2n-1}] (* Jean-François Alcover, Jun 15 2019, from Maple *)
  • PARI
    {T(n,k) = local(p=4);if(2*n
    				
  • PARI
    /* Alternate Recurrence: */
    {T(n,k) = local(p=4);if(2*n
    				
  • SageMath
    from functools import cache
    @cache
    def R(n, k):
          return (1 if n == 1 else sum(R(n-1, j) for j in range(1, 2*n-2))
                    if k == 1 else 5*R(n, 1) if k == 2 else R(n, 2*n-k)
                    if k > n else 2*R(n, k-1) - R(n, k-2) - 8*R(n-1, k-2))
    def A126155(n, k): return R(n+1, k+1)
    for n in range(5): print([A126155(n, k) for k in range(2*n+1)])
    # Peter Luschny, Dec 14 2023

Formula

Sum_{k=0..2n} (-1)^k*C(2n,k)*T(n,k) = (-8)^n.