login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

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 60th year, we have over 367,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
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 December 6 01:58 EST 2023. Contains 367594 sequences. (Running on oeis4.)