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.

Showing 1-1 of 1 results.

A378961 Number of sets of nonzero triangular numbers whose largest element is the n-th triangular number and whose sum is a triangular number.

Original entry on oeis.org

1, 1, 2, 1, 3, 5, 5, 11, 19, 33, 55, 92, 192, 327, 579, 1142, 2052, 3776, 6936, 12964, 24308, 44432, 84763, 159299, 299093, 567295, 1075570, 2045580, 3883453, 7411014, 14164089, 27044407, 51759660, 99259961, 190371661, 365537357, 702901278, 1352868238, 2606296357
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 12 2024

Keywords

Examples

			a(5) = 3 subsets of triangular numbers whose largest element is A000217(5)=15 and whose sum is in A000217: {15}, {6, 15} and {3, 10, 15}.
		

Crossrefs

Cf. A000217, A339612, A339613, A377123 (partial sums).

Programs

  • Maple
    istri:= proc(n) issqr(1+8*n) end proc:
    tri:= n -> n*(n+1)/2:
    F:= proc(n,s) option remember; local v;
      if s = 0 then return 1 fi;
      if s > n*(n+1)*(n+2)/6 then return 0 fi;
      v:= tri(n);
      if s >= v then procname(n-1,s-v) + procname(n-1,s)
      else procname(n-1,s)
      fi;
    end proc:
    f:= proc(n) local i,t,m;
       t:= 0;
       m:= n*(n+1)*(n+2)/6;
       for i from 1 while tri(i) <= m do
         t:= t + F(n,tri(i)) - F(n-1,tri(i))
       od;
       t
    end proc:
    map(f, [$1..50]); # Robert Israel, Jan 13 2025
Showing 1-1 of 1 results.