OFFSET
1,26
LINKS
FORMULA
EXAMPLE
a(18) = 1; 18 = 2 + 5 + 11, which is the only partition of 18 into 3 mutually nonadjacent prime parts.
MAPLE
with(numtheory): A307343:=n->add(add((pi(k)-pi(k-1))*(pi(i)-pi(i-1))*(pi(n-i-k)-pi(n-i-k-1))*(1-floor((pi(k)+1)/pi(i)))*(1-floor((pi(i)+1)/pi(n-i-k))), i=k+1..floor((n-k-1)/2)), k=1..floor((n-1)/3)): seq(A307343(n), n=1..150);
# second Maple program:
b:= proc(n, i) option remember; `if`(n=0, [1, 0$3], `if`(i<1, [0$4],
zip((x, y)-> x+y, b(n, i-1), [0, `if`(ithprime(i)>n, [0$3],
b(n-ithprime(i), i-2)[1..3])[]], 0)))
end:
a:= n-> b(n, numtheory[pi](n))[4]:
seq(a(n), n=1..200); # Alois P. Heinz, Apr 05 2019
MATHEMATICA
Table[Sum[Sum[(1 - Floor[(PrimePi[k] + 1)/PrimePi[i]]) (1 - Floor[(PrimePi[i] + 1)/PrimePi[n - i - k]]) (PrimePi[i] - PrimePi[i - 1])*(PrimePi[k] - PrimePi[k - 1]) (PrimePi[n - i - k] - PrimePi[n - i - k - 1]), {i, k + 1, Floor[(n - k - 1)/2]}], {k, Floor[(n - 1)/3]}], {n, 100}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 02 2019
STATUS
approved