editing
approved
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”).
editing
approved
Alois P. Heinz, <a href="/A276852/b276852.txt">Table of n, a(n) for n = 0..1292</a>
0, 1, 2, 7, 28, 121, 560, 2677, 13230, 66742, 343092, 1788681, 9439870, 50321865, 270594896, 1465941763, 7993664588, 43839212778, 241650560756, 1338084935826, 7439615051328, 41516113036777, 232452845782308, 1305500166481715, 7352433083806020, 41514430735834714
approved
editing
editing
approved
nonn,more,walk,changed
proposed
editing
editing
proposed
A276852[n_] := (Do[walks[m, k, 3], {m, n}, {k, 3 m}]; walks[n, 1, 3]; ) (* Davin Park, Oct 10 2016 *)
dpwalks[n_, k_, h_] = 0;
dpwalks[1, k_, h_] := Boole[0 < k <= h];
dpwalks[n_, k_, h_] /; n >= 2 && k > 0 := dpwalks[n, k, h] = Sum[dpwalks[n - 1, k - x, h], {x, h}] + Sum[dpwalks[n - 1, k + x, h], {x, h}];
(* walks represents the number of positive walks with n steps {-h, -h+1, ... -1, 1, ..., h} that end at altitude k *)
A276852[n_] := dpwalks[n, 1, 3]; (* Davin Park, Oct 10 2016 *)
proposed
editing
editing
proposed