Displaying 1-9 of 9 results found.
page
1
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.
+10
15
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
MATHEMATICA
walks[n_, k_, h_] = 0;
walks[1, k_, h_] := Boole[0 < k <= h];
walks[n_, k_, h_] /; n >= 2 && k > 0 := walks[n, k, h] = Sum[walks[n - 1, k - x, h], {x, h}] + Sum[walks[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_] := (Do[walks[m, k, 3], {m, n}, {k, 3 m}]; walks[n, 1, 3]) (* Davin Park, Oct 10 2016 *)
Number of positive walks with n steps {-3,-2,-1,1,2,3} starting at the origin, ending at altitude 2, and staying strictly above the x-axis.
+10
10
0, 1, 2, 9, 34, 159, 730, 3579, 17762, 90538, 467796, 2452727, 12997554, 69549847, 375159290, 2038068813, 11140256754, 61227097438, 338140106124, 1875581756078, 10444142352812, 58364192607047, 327203347219250, 1839778650617309, 10372512509521074
MATHEMATICA
walks[n_, k_, h_] = 0;
walks[1, k_, h_] := Boole[0 < k <= h];
walks[n_, k_, h_] /; n >= 2 && k > 0 := walks[n, k, h] = Sum[walks[n - 1, k - x, h], {x, h}] + Sum[walks[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 *)
A276901[n_] := (Do[walks[m, k, 3], {m, n}, {k, 3 m}]; walks[n, 2, 3]) (* Davin Park, Oct 10 2016 *)
Number of positive walks with n steps {-3,-2,-1,0,1,2,3} starting at the origin, ending at altitude 1, and staying strictly above the x-axis.
+10
10
0, 1, 3, 12, 56, 284, 1526, 8530, 49106, 289149, 1733347, 10542987, 64904203, 403632551, 2531971729, 16002136283, 101795589297, 651286316903, 4188174878517, 27055199929042, 175488689467350, 1142479579205721, 7462785088260791, 48896570201100002
MATHEMATICA
walks[n_, k_, h_] = 0;
walks[1, k_, h_] := Boole[0 < k <= h];
walks[n_, k_, h_] /; n >= 2 && k > 0 := walks[n, k, h] = Sum[walks[n - 1, k + x, h], {x, -h, h}];
(* walks represents the number of positive walks with n steps {-h, -h+1, ... , h} that end at altitude k *)
A276902[n_] := (Do[walks[m, k, 3], {m, n}, {k, 3 m}]; walks[n, 1, 3]) (* Davin Park, Oct 10 2016 *)
Number of positive walks with n steps {-3,-2,-1,0,1,2,3} starting at the origin, ending at altitude 2, and staying strictly above the x-axis.
+10
9
0, 1, 3, 14, 68, 358, 1966, 11172, 65104, 387029, 2337919, 14309783, 88555917, 553171371, 3483277785, 22087378303, 140913963221, 903876307075, 5825742149049, 37710582868464, 245052827645474, 1598017940728401, 10454217006683855, 68591382498826168
MATHEMATICA
walks[n_, k_, h_] = 0;
walks[1, k_, h_] := Boole[0 < k <= h];
walks[n_, k_, h_] /; n >= 2 && k > 0 := walks[n, k, h] = Sum[walks[n - 1, k + x, h], {x, -h, h}];
(* walks represents the number of positive walks with n steps {-h, -h+1, ... , h} that end at altitude k *)
A276904[n_] := (Do[walks[m, k, 3], {m, n}, {k, 3 m}]; walks[n, 2, 3]) (* Davin Park, Oct 10 2016 *)
Number of positive meanders (walks starting at the origin and ending at any altitude > 0 that never touch or go below the x-axis in between) with n steps from {-2,-1,0,1,2}.
+10
7
1, 2, 7, 29, 126, 565, 2583, 11971, 56038, 264345, 1254579, 5983628, 28655047, 137697549, 663621741, 3206344672, 15525816066, 75324830665, 366071485943, 1781794374016, 8684511754535, 42381025041490, 207055067487165, 1012617403658500, 4956924278927910
COMMENTS
By convention, the empty walk (corresponding to n=0) is considered to be a positive meander.
MATHEMATICA
frac[ex_] := Select[ex, Exponent[#, x] < 0&];
seq[n_] := Module[{v, m, p}, v = Table[0, n]; m = Sum[x^i, {i, -2, 2}]; p = 1/x; v[[1]] = 1; For[i = 2, i <= n, i++, p = p*m // Expand; p = p - frac[p]; v[[i]] = p /. x -> 1]; v];
PROG
(PARI) seq(n)={my(v=vector(n), m=sum(i=-2, 2, x^i), p=1/x); v[1]=1; for(i=2, n, p*=m; p-=frac(p); v[i]=subst(p, x, 1)); v} \\ Andrew Howroyd, Jun 27 2018
Number of positive walks with n steps {-4,-3,-2,-1,0,1,2,3,4} starting at the origin, ending at altitude 1, and staying strictly above the x-axis.
+10
1
0, 1, 4, 20, 120, 780, 5382, 38638, 285762, 2162033, 16655167, 130193037, 1030117023, 8234025705, 66391916397, 539360587341, 4410492096741, 36274113675369, 299864297741292, 2490192142719336, 20764402240048267, 173784940354460219, 1459360304511145146
MAPLE
b:= proc(n, y) option remember; `if`(n=0, `if`(y=1, 1, 0),
add((h-> `if`(h<1, 0, b(n-1, h)))(y+d), d=-4..4))
end:
a:= n-> b(n, 0):
MATHEMATICA
b[n_, y_] := b[n, y] = If[n == 0, If[y == 1, 1, 0], Sum[Function[h, If[h < 1, 0, b[n - 1, h]]][y + d], {d, -4, 4}]];
a[n_] := b[n, 0];
Number of positive walks with n steps {-4,-3,-2,-1,0,1,2,3,4} starting at the origin, ending at altitude 2, and staying strictly above the x-axis.
+10
1
0, 1, 4, 23, 142, 950, 6662, 48420, 361378, 2753687, 21334313, 167551836, 1330894754, 10673486660, 86306300366, 702872359332, 5759986152740, 47463395965108, 393027545388119, 3268814565684836, 27294209365111429, 228718165320327356, 1922825557218427271
Number of positive walks with n steps {-4,-3,-2,-1,1,2,3,4} starting at the origin, ending at altitude 1, and staying strictly above the x-axis.
+10
1
0, 1, 3, 13, 71, 405, 2501, 15923, 104825, 704818, 4827957, 33549389, 235990887, 1676907903, 12019875907, 86804930199, 630999932585, 4613307289260, 33900874009698, 250257489686870, 1854982039556397, 13800559463237465, 103017222722691145, 771348369563479705
MAPLE
b:= proc(n, y) option remember; `if`(n=0, `if`(y=1, 1, 0), add
((h-> `if`(h<1, 0, b(n-1, h)))(y+d), d=[$-4..-1, $1..4]))
end:
a:= n-> b(n, 0):
MATHEMATICA
b[n_, y_] := b[n, y] = If[n == 0, If[y == 1, 1, 0], Sum[Function[h, If[h < 1, 0, b[n - 1, h]]][y + d], {d, Join[Range[-4, -1], Range[4]]}]];
a[n_] := b[n, 0];
Number of positive walks with n steps {-4,-3,-2,-1,1,2,3,4} starting at the origin, ending at altitude 2, and staying strictly above the x-axis.
+10
1
0, 1, 3, 16, 84, 505, 3121, 20180, 133604, 904512, 6224305, 43432093, 306524670, 2184389874, 15695947669, 113595885023, 827299204132, 6058526521135, 44586954104578, 329579179316696, 2445858862779018, 18216235711289695, 136113075865844577, 1020074492384232296
Search completed in 0.009 seconds
|