Consider the following fairly simple Mathematica code
Block[{a={a1},n=3},
While[n<=32,
a=AppendTo[a,(PrimePi[n]-Sum[a[[k]] PrimePi[k],{k,1,n-2}])/PrimePi[n-1]];
n++];
a]
which generates the first few values of $a_k$ as follows
$$a=\left\{a_1,2,0,\frac{1}{2},0,\frac{1}{3},0,0,0,\frac{1}{4},0,\frac{1}{5},0,0,0,\frac{1}{6},0,\frac{1}{7},0,0,0,\frac{1}{8},0,0,0,0,0,\frac{1}{9},0,\frac{1}{10},0\right\}$$
starting at $a_1$ where
$$\pi(n)=\sum\limits_{k=1}^{n-1} \pi(k)\, a_k\,,\quad n>2\tag{1}.$$
For the recursive formula in the question above, the following slightly more complicated Mathematica code
Block[{c={},n=3},
While[n<=32,
c=AppendTo[c,(n-2) PrimePi[n]-Sum[PrimePi[k] c[[n-k]],{k,3,n-1}]];
n++];
c]
generates the first few values of $c_k$ as follows
$c=\{2,0,5,-4,12,-15,23,-36,68,-100,167,-259,405,-651,1050,-1652,2637,-4182,6633,-10564,16805,-26675,42391,-67371,107062,-170183,270473,-429783,683068,-1085560\}$
starting at $c_0=2$ where
$$\pi(n)=\frac{1}{n-2} \sum\limits_{k=0}^{n-1} \pi(k)\, c_{n-1-k}\,,\quad n>2\tag{2}.$$
Note that
$$c-1=\{1,-1,4,-5,11,-16,22,-37,67,-101,166,-260,404,-652,1049,-1653,2636,-4183,6632,-10565,16804,-26676,42390,-67372,107061,-170184,270472,-429784,683067,-1085561\}$$
corresponds to OEIS Entry A307977.
The two Mathematica programs above compensate for the fact that the first element of a Mathematica list has index $1$ instead of index $0$ which is more typical of programming languages.
I believe the formula
$$\pi(x)=\sum\limits_{k=1}^x \left(\left\{\begin{array}{cc} 1 & k=2+\sum\limits_{p<k} (c_{k-p-1}-1) \\ 0 & \text{Otherwise} \\ \end{array}\right.\right)\tag{3}$$
where $p$ is a prime is valid for all $x\in\mathbb{R}$.