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.

A291878 Triangle read by rows: T(n,k) = number of fountains of n coins and height k.

This page as a plain text file.
%I A291878 #48 May 31 2019 05:24:45
%S A291878 1,0,1,0,1,0,1,1,0,1,2,0,1,4,0,1,7,1,0,1,12,2,0,1,20,5,0,1,33,11,0,1,
%T A291878 54,22,1,0,1,88,44,2,0,1,143,85,5,0,1,232,161,12,0,1,376,302,25,0,1,
%U A291878 609,559,52,1,0,1,986,1026,105,2,0,1,1596,1870,207,5,0,1
%N A291878 Triangle read by rows: T(n,k) = number of fountains of n coins and height k.
%C A291878 Same as A187080, with trailing zeros omitted.
%H A291878 Alois P. Heinz, <a href="/A291878/b291878.txt">Rows n = 0..1000, flattened</a>
%e A291878 T(6, 1) = 1;
%e A291878 . O O O O O O .
%e A291878 -------------------------------------------------------
%e A291878 T(6, 2) = 7;
%e A291878 .. O O ......... O O ..... O . O ..
%e A291878 . O O O O ... O O O O ... O O O O .
%e A291878 .......................................................
%e A291878 .. O ............. O ............. O ............. O ..
%e A291878 . O O O O O ... O O O O O ... O O O O O ... O O O O O .
%e A291878 -------------------------------------------------------
%e A291878 T(6, 3) = 1;
%e A291878 ... O ...
%e A291878 .. O O ..
%e A291878 . O O O .
%e A291878 -------------------------------------------------------
%e A291878 First few rows are:
%e A291878   1;
%e A291878   0,  1;
%e A291878   0,  1;
%e A291878   0,  1,   1;
%e A291878   0,  1,   2;
%e A291878   0,  1,   4;
%e A291878   0,  1,   7,   1;
%e A291878   0,  1,  12,   2;
%e A291878   0,  1,  20,   5;
%e A291878   0,  1,  33,  11;
%e A291878   0,  1,  54,  22,  1;
%e A291878   0,  1,  88,  44,  2;
%p A291878 b:= proc(n, i, h) option remember; `if`(n=0, x^h,
%p A291878       add(b(n-j, j, max(h, j)), j=1..min(i+1, n)))
%p A291878     end:
%p A291878 T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$2)):
%p A291878 seq(T(n), n=0..30);  # _Alois P. Heinz_, Sep 05 2017
%t A291878 b[n_, i_, h_] := b[n, i, h] = If[n == 0, x^h, Sum[b[n - j, j, Max[h, j]], {j, 1, Min[i + 1, n]}]];
%t A291878 T[n_] := Table[Coefficient[#, x, i], {i, 0, Exponent[#, x]}]& @ b[n, 0, 0];
%t A291878 Table[T[n], {n, 0, 30}] // Flatten (* _Jean-François Alcover_, May 31 2019, after _Alois P. Heinz_ *)
%o A291878 (Python)
%o A291878 from sympy.core.cache import cacheit
%o A291878 from sympy import Symbol, Poly, flatten
%o A291878 x=Symbol('x')
%o A291878 @cacheit
%o A291878 def b(n, i, h): return x**h if n==0 else sum([b(n - j, j, max(h, j)) for j in range(1, min(i + 1, n) + 1)])
%o A291878 def T(n): return 1 if n==0 else Poly(b(n, 0, 0)).all_coeffs()[::-1]
%o A291878 print(flatten(map(T, range(31)))) # _Indranil Ghosh_, Sep 06 2017
%Y A291878 Row sums give A005169.
%Y A291878 Columns 0-2 give A000007, A000012, A000071.
%Y A291878 Cf. A047998, A187080.
%K A291878 nonn,tabf
%O A291878 0,11
%A A291878 _Seiichi Manyama_, Sep 05 2017