OFFSET
1,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..300
EXAMPLE
a(3) = 2: [2,3], [3,2].
a(4) = 5: [5,2], [2,5], [3,2,2], [2,3,2], [2,2,3].
MAPLE
b:= proc(n, c) option remember; `if`(n=0, `if`(isprime(c),
1, 0), add(`if`(isprime(j), b(n-j, c+1), 0), j=2..n))
end:
a:= n-> b(ithprime(n), 0):
seq(a(n), n=1..31);
MATHEMATICA
b[n_, c_] := b[n, c] = If[n == 0, If[PrimeQ[c], 1, 0],
Sum[If[PrimeQ[j], b[n - j, c + 1], 0], {j, 2, n}]];
a[n_] := b[Prime[n], 0];
Table[a[n], {n, 1, 31}] (* Jean-François Alcover, Apr 04 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, May 28 2021
STATUS
approved