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.

A129852 Nondescending wiggly sums: number of sums adding to n in which terms alternately do not decrease and do not increase.

This page as a plain text file.
%I A129852 #23 May 23 2023 16:16:09
%S A129852 1,1,2,3,5,9,15,26,45,79,135,236,408,710,1230,2137,3705,6436,11165,
%T A129852 19384,33637,58391,101336,175896,305284,529884,919683,1596277,2770576,
%U A129852 4808811,8346446,14486644,25143896,43641363,75746646,131470683,228188723,396058740,687424365,1193136983,2070883422
%N A129852 Nondescending wiggly sums: number of sums adding to n in which terms alternately do not decrease and do not increase.
%H A129852 Alois P. Heinz, <a href="/A129852/b129852.txt">Table of n, a(n) for n = 0..2000</a>
%e A129852 From _Joerg Arndt_, May 21 2013: (Start)
%e A129852 The a(6)=15 such compositions are
%e A129852 01:  [ 1 1 1 1 1 1 ]
%e A129852 02:  [ 1 1 1 2 1 ]
%e A129852 03:  [ 1 1 1 3 ]
%e A129852 04:  [ 1 2 1 1 1 ]
%e A129852 05:  [ 1 2 1 2 ]
%e A129852 06:  [ 1 3 1 1 ]
%e A129852 07:  [ 1 3 2 ]
%e A129852 08:  [ 1 4 1 ]
%e A129852 09:  [ 1 5 ]
%e A129852 10:  [ 2 2 1 1 ]
%e A129852 11:  [ 2 2 2 ]
%e A129852 12:  [ 2 3 1 ]
%e A129852 13:  [ 2 4 ]
%e A129852 14:  [ 3 3 ]
%e A129852 15:  [ 6 ]
%e A129852 (End)
%p A129852 A129852rec := proc(part,n) local asum,a,k ; asum := add(i,i=part) ; if asum > n then RETURN(0) ; elif asum = n then RETURN(1) ; else a := 0 ; if nops(part) mod 2 = 1 then for k from op(-1,part) to n-asum do a := a+A129852rec([op(part),k],n) ; od: else for k from 1 to min(op(-1,part),n-asum) do a := a+A129852rec([op(part),k],n) ; od: fi ; RETURN(a) ; fi ; end: A129852 := proc(n) local a,a1 ; a := 0 ; for a1 from 1 to n do a := a+A129852rec([a1],n) ; od: RETURN(a) ; end: seq(A129852(n),n=1..20) ; # _R. J. Mathar_, Oct 31 2007
%p A129852 # second Maple program:
%p A129852 b:= proc(n, l, t) option remember; `if`(n=0, 1, add(
%p A129852       b(n-j, j, not t), j=`if`(t, l..n, 1..min(n, l))))
%p A129852     end:
%p A129852 a:= n-> b(n$2, false):
%p A129852 seq(a(n), n=0..40);  # _Alois P. Heinz_, May 23 2023
%t A129852 b[n_, l_, t_] := b[n, l, t] = If[n == 0, 1, Sum[b[n-j, j, !t], {j, If[t, Range[l, n], Range[Min[n, l]]]}]];
%t A129852 a[n_] := b[n, n, False];
%t A129852 Table[a[n], {n, 0, 40}] (* _Jean-François Alcover_, May 23 2023, after _Alois P. Heinz_ *)
%Y A129852 Cf. A129853.
%Y A129852 Cf. A025048, A025049.
%K A129852 nonn
%O A129852 0,3
%A A129852 _Vladeta Jovovic_, May 22 2007
%E A129852 More terms from _R. J. Mathar_, Oct 31 2007
%E A129852 More terms from _Joerg Arndt_, May 21 2013
%E A129852 a(0)=1 prepended by _Alois P. Heinz_, May 23 2023