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.

A297438 A divisor analog of the Motzkin numbers A001006.

This page as a plain text file.
%I A297438 #8 Oct 27 2019 12:01:14
%S A297438 1,1,2,3,7,12,29,56,134,283,672,1496,3568,8214,19678,46364,111766,
%T A297438 267467,648941,1570540,3833777,9357181,22967808,56430230,139193762,
%U A297438 343825265,851777363,2113382992,5255584309,13089273904
%N A297438 A divisor analog of the Motzkin numbers A001006.
%C A297438 By changing the upper summation index in the recurrence from k-1 to n-1 we get the Motzkin numbers A001006.
%C A297438 That is, by changing
%C A297438   Sum_{i=1..k-1} t(n-i, k-1) - Sum_{i=1..k-1} t(n-i, k)
%C A297438 into
%C A297438   Sum_{i=1..n-1} t(n-i, k-1) - Sum_{i=1..n-1} t(n-i, k),
%C A297438 we get the Motzkin numbers.
%C A297438 With this change of upper summation index, a(n) is to A001006 as A239605 is to A000108.
%t A297438 Clear[t, n, k, i, nn, x];
%t A297438 coeff = {1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
%t A297438    0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
%t A297438 mp[m_, e_] :=
%t A297438 If[e == 0, IdentityMatrix@Length@m, MatrixPower[m, e]]; nn =
%t A297438 Length[coeff]; cc = Range[nn]*0 + 1; Monitor[
%t A297438 Do[Clear[t]; t[n_, 1] := t[n, 1] = cc[[n]];
%t A297438   t[n_, k_] :=
%t A297438    t[n, k] =
%t A297438     If[n >= k,
%t A297438      Sum[t[n - i, k - 1], {i, 1, k - 1}] -
%t A297438       Sum[t[n - i, k], {i, 1, k - 1}], 0];
%t A297438   A4 = Table[Table[t[n, k], {k, 1, nn}], {n, 1, nn}];
%t A297438   A5 = A4[[1 ;; nn - 1]]; A5 = Prepend[A5, ConstantArray[0, nn]];
%t A297438   cc = Total[
%t A297438     Table[coeff[[n]]*mp[A5, n - 1][[All, 1]], {n, 1, nn}]];, {i, 1,
%t A297438    nn}], i]; cc
%Y A297438 Cf. A001006, A239605.
%K A297438 nonn
%O A297438 1,3
%A A297438 _Mats Granvik_, Dec 30 2017