The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A308241 Total number of nodes summed over all lattice paths from (0,0) to (n,n) that consist of steps (h,v) with h, v prime or one. 3
1, 2, 5, 18, 68, 244, 880, 3228, 11905, 43966, 162498, 600984, 2222776, 8218022, 30368708, 112162230, 414006377, 1527214022, 5630258676, 20744334800, 76387507859, 281129870088, 1034103899368, 3801934437930, 13971364199298, 51318841190524, 188420580871859 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
MAPLE
b:= proc(x, y) option remember; `if`(y=0, [1$2], (p-> p+[0, p[1]])(
add(add(`if`((h=1 or isprime(h)) and (v=1 or isprime(v)),
b(sort([x-h, y-v])[]), 0), v=1..y), h=1..x)))
end:
a:= n-> b(n$2)[2]:
seq(a(n), n=0..30);
MATHEMATICA
f[p_List] := p + {0, p[[1]]}; f[0] = 0;
b[{x_, y_}] := b[{x, y}] = If[y == 0, {1, 1}, f[
Sum[Sum[If[(h == 1 || PrimeQ[h]) && (v == 1 || PrimeQ[v]),
b[Sort@{x - h, y - v}], {0, 0}], {v, 1, y}], {h, 1, x}]]];
a[n_] := b[{n, n}][[2]];
a /@ Range[0, 30] (* Jean-François Alcover, Apr 05 2021, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A150023 A150024 A150025 * A363061 A288910 A249062
KEYWORD
nonn
AUTHOR
Alois P. Heinz, May 16 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 23 03:55 EDT 2024. Contains 372758 sequences. (Running on oeis4.)