Let $a(n)$ be [A227559](http://oeis.org/A227559), i.e., number of partitions of $n$ into distinct parts with boundary size $2$. Be careful here: offset is $3$.


I conjecture that $a(4n+2)=2n+1$ for $n>0$ if and only if $2n+1$ is a prime number.


I guess that my conjecture has no interest, in the event that the generation of the sequence is associated with prime numbers. I visited [A227345](http://oeis.org/A227345), but I never figured out exactly how the sequence is generated.


Is there a way to prove it?



Prime numbers and number of partitions of $n$ into distinct parts with boundary size $2$
There always exist exactly $2n$ partitions of $4n+2$ onto 2 distinct parts. Also, there exists a partition with parts $n-1,n,n+1,n+2$.


Any other partition of $4n+2$ onto distinct parts with boundary size 2, say, with $k>2$ parts, corresponds to a representations $4n+2=x+(x+1)+\ldots+(x+k-1)=k(2x+k-1)/2$, so $k(2x+k-1)=4(2n+1)$.


If $2n+1$ is prime, the number
$4(2n+1)$ has only two factorizations $4(2n+1)=ab$ with factors $a, b$ of distinct parity: $1 \times (8n+4)$ and $4\times (2n+1)$. The first case would mean $k=1$ which is absurd, in the second case $k=4$, which is already counted.


On the other hand, if $2n+1=pq$ is a factorization with $1<p\leqslant q$, we may take $k=p$, $2 x+k-1=4q$ and get an extra partition.


