Take a number $N = \overline{abcde...}$ where $a, b, c, d,e,\dots$ are the digits of $N$.
Let $k$ be the sum of those digits : $a+b+c+d+e+{}... = k$
If $k$ is any of ${1, 2, 4, 5, 7, 8}$, then $N$ is prime. Otherwise it is not a prime.
Example: $N = 17$ and $k = 1 + 7 = 8$. Therefore $N$ is prime.
Now, I want to know the following:
Is my guess correct, and if so, how can I prove it mathematically?
If I am wrong, where I am wrong?
Regards-Gandhi, Thanks!

Any number is congruent with the sum of its digits modulo 9.
Therefore, if the sum of the digits is 3,6 or 0 $\pmod{9}$ the number is divisible by $3$. And in this case, the number is either $3$ or composite.
If the sum of the digits is $1,2,4,5,7,8 \pmod{9}$ the number could be prime. There are infinitely many numbers of this form which are not prime, and Dirichlet Theorem tells us that there are also infinitely many numbers of this form which are prime.