Proof for a prime-generating sequence Let $k$ be a positive integer.
Let $n$ be an integer such that $n=6k-1$
Let $r$ be the remainder of the division of $(n-1)!-n$ by $(n+2)$
Conjecture: if $6k+1$ is prime $r=3k+2$
For example the first 25 values of $r$ are:
${5,8,11,2,17,20,23,2,2,32,35,38,41,2,2,50,53,56,2,2,65,2,71,2,77}$
And we have:
$8+5=13=6(2)+1$
$11+8=19=6(3)+1$
$20+17=37=6(6)+1$
$23+20=43=6(7)+1$
$35+32=67=6(11)+1$
$38+35=73=6(12)+1$
$41+38=79=6(13)+1$
$53+50=103=6(17)+1$
$56+53=109=6(18)+1$
I have already proved that if $6k+1$ is a composite number $r=2$ but I failed to prove this conjecture.
Is it hard to prove it?
Thanks.

$$n+2=6k+1$$ by Wilson's theorem $$(n+1)!\equiv -1\pmod {n+2}$$ it follows that $$n!\equiv 1\pmod{n+2}$$ and that $$(n-1)!\equiv -(2^{-1})\equiv 3k\pmod {n+2}$$ and $$-n\equiv 2\pmod {n+2}$$ so together we have $$3k+2$$ as the remainder $\blacksquare$
As to the addition chains $$(3k+2)+(3(k+1)+2)=6(k+1)+1$$ so what.
