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.

A339441 Number of compositions (ordered partitions) of n into an even number of distinct triangular numbers.

This page as a plain text file.
%I A339441 #12 Mar 14 2021 11:43:19
%S A339441 1,0,0,0,2,0,0,2,0,2,0,2,0,2,0,0,4,0,2,0,24,2,2,0,2,26,0,2,0,26,0,28,
%T A339441 24,0,26,24,2,2,50,2,48,0,26,26,0,48,28,72,2,26,48,4,48,48,24,74,770,
%U A339441 2,50,48,50,26,72,720,98,74,26,74,48,770,74,768,26,122,792,72
%N A339441 Number of compositions (ordered partitions) of n into an even number of distinct triangular numbers.
%H A339441 Alois P. Heinz, <a href="/A339441/b339441.txt">Table of n, a(n) for n = 0..10000</a>
%H A339441 <a href="/index/Com#comp">Index entries for sequences related to compositions</a>
%H A339441 <a href="/index/Pol#polygonal_numbers">Index to sequences related to polygonal numbers</a>
%e A339441 a(20) = 24 because we have [10, 6, 3, 1] (24 permutations).
%p A339441 b:= proc(n, i, p) option remember; `if`(n=0, irem(1+p, 2)*p!, (t->
%p A339441      `if`(t>n, 0, b(n, i+1, p)+b(n-t, i+1, p+1)))(i*(i+1)/2))
%p A339441     end:
%p A339441 a:= n-> b(n, 1, 0):
%p A339441 seq(a(n), n=0..100);  # _Alois P. Heinz_, Dec 05 2020
%t A339441 b[n_, i_, p_] := b[n, i, p] = If[n == 0, Mod[1 + p, 2]*p!, With[{t = i(i+1)/2}, If[t > n, 0, b[n, i + 1, p] + b[n - t, i + 1, p + 1]]]];
%t A339441 a[n_] := b[n, 1, 0];
%t A339441 a /@ Range[0, 100] (* _Jean-François Alcover_, Mar 14 2021, after _Alois P. Heinz_ *)
%Y A339441 Cf. A000217, A331843, A332305, A339375, A339416, A339442.
%K A339441 nonn
%O A339441 0,5
%A A339441 _Ilya Gutkovskiy_, Dec 05 2020