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.

A174382 T(1,0)=0 and for n > 1, T(n,k) is the number of k's in rows 1 to n - 1.

This page as a plain text file.
%I A174382 #25 Aug 25 2025 17:00:40
%S A174382 0,1,1,1,1,3,1,4,0,1,2,6,0,1,1,3,8,1,1,1,0,1,4,12,1,2,1,0,1,0,1,6,16,
%T A174382 2,2,2,0,1,0,1,0,0,0,1,11,19,5,2,2,0,2,0,1,0,0,0,1,0,0,0,1,19,22,8,2,
%U A174382 2,1,2,0,1,0,0,1,1,0,0,0,1,0,0,1,27,28,11,2,2,1,2,0,2,0,0,1,1,0,0,0,1,0,0,2,0,0,1
%N A174382 T(1,0)=0 and for n > 1, T(n,k) is the number of k's in rows 1 to n - 1.
%C A174382 Construction as in A333867 but starting with a 0 and including a count of 0s at the start of each row. [Edited by _Peter Munn_, Oct 11 2022]
%C A174382 See A342585 for a similarly defined sequence that has been analyzed more and has lists of other related sequences. - _Peter Munn_, Oct 08 2022
%H A174382 Reinhard Zumkeller, <a href="/A174382/b174382.txt">Rows n = 1..25 of table, flattened</a>
%e A174382 0;
%e A174382 1; # one zero
%e A174382 1,1; # one zero, one one
%e A174382 1,3; # one zero, three ones
%e A174382 1,4,0,1; # one zero, four ones, zero twos, one three
%p A174382 b:= proc(n) option remember; `if`(n<1, 0, b(n-1)+add(x^i, i=T(n))) end:
%p A174382 T:= proc(n) option remember; `if`(n=1, 0, (p->
%p A174382       seq(coeff(p, x, i), i=0..degree(p)))(b(n-1)))
%p A174382     end:
%p A174382 seq(T(n), n=1..12);  # _Alois P. Heinz_, Aug 25 2025
%o A174382 (Haskell)
%o A174382 import Data.List (sort, group)
%o A174382 a174382 n k = a174382_tabf !! (n-1) !! k
%o A174382 a174382_row n = a174382_tabf !! (n-1)
%o A174382 a174382_tabf = iterate f [0] where
%o A174382    f xs = g (xs ++ [0, 0 ..]) [0..] (map head zs) (map length zs)
%o A174382      where g _ _ _ [] = []
%o A174382            g (u:us) (k:ks) hs'@(h:hs) vs'@(v:vs)
%o A174382              | k == h = u + v : g us ks hs vs
%o A174382              | k /= h = u : g us ks hs' vs'
%o A174382            zs = group $ sort xs
%o A174382 -- _Reinhard Zumkeller_, Apr 06 2014
%Y A174382 Cf. A240508 (row lengths).
%Y A174382 Cf. A333867, A342585.
%K A174382 easy,nonn,tabf,look,changed
%O A174382 1,6
%A A174382 _Paolo P. Lava_ & _Giorgio Balzarotti_, Mar 17 2010