A276852[n_] := dp[n, 1, 3]; (* _Davin Park_, Oct 10 2016 *)
Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
A276852[n_] := dp[n, 1, 3]; (* _Davin Park_, Oct 10 2016 *)
dp[n_, k_, h_] = 0;
dp[1, k_, h_] := Boole[0 < k <= h];
dp[n_, k_, h_] /; n >= 2 && k > 0 := dp[n, k, h] = Sum[dp[n - 1, k - x, h], {x, h}] + Sum[dp[n - 1, k + x, h], {x, h}];
A276852[n_] := dp[n, 1, 3];
approved
editing
reviewed
approved
proposed
reviewed
editing
proposed
editing
proposed
editing
proposed
Number of positive walks with n steps {-3,-2,-1,1,2,3} starting at the origin, ending at altitude 1, and staying strictly above the x-axis.
proposed
editing