0
$\begingroup$

I'm trying to generate odd prime numbers such that their totients are co-prime with $5$. I want to know if what I'm doing is correct, or can be proven.

  1. Assume $2, 3$ and $5$ are primes
  2. Check if $10i - 3, 10i - 1, 10i + 3$ for $i$ greater or equal to $1$

now I did the following to get those forms and I wonder if the approach is correct:

  1. Assume every integer is in the form of $5n-2, 5n-1, 5n, 5n+1, 5n+2$

  2. substitute each of them with $k$ in $2k+1,$ and get $10n-3, 10n-1, 10n+1, 10n+3, 10n+5$

  3. remove the forms that don't form prime for n in positive integers and have the forms reduced to $10n-3, 10n-1, 10n+1, 10n+3$

  4. totient of a prime $p$ is $p-1,$ so subtract $1$ from each of the forms and see if they're divisible by $5$ for every positive integer $n, 10n-4, 10n-2, 10n+2$.

  5. check numbers of the form $10i-3, 10i-1$ and $10i+3$ for primality.

  • 0
    Your title doesn't match the body as it does not mention the totient. The title is easy to answer-any odd number that doesn't end in $5$. The totient of a prime $p$ is $p-1$, so you are asking for primes that are not $5k+1$. The easiest approach to this is just to pick numbers not $1 \bmod 5$ and test for primality, but it appears you have other criteria.2017-01-02
  • 0
    @RossMillikan I updated the title, thanks. My cirteria are number to be odd, prime, and have its totient coprime with 5. So if there is a reduced for of numbers I'd appreciate that.2017-01-02
  • 0
    You are checking numbers that end in $7,9,1$ for primality, but not numbers that end in $3$. There is nothing wrong with those that end in $3$-as $13$ and $23$ seem to meet your requirement. I think you should just pick non $1 \bmod 5$ numbers and check for primality. You can improve your odds by prefiltering for small factors, which is essentially what your ending digit does. You can pick $k \bmod {210}$, for example with $k$ coprime to $2,3,5,7$ and generate numbers of the form $210m+k$2017-01-02
  • 0
    @RossMillikan I'm sorry, I've made a mistake on my last line, 10i+1 should be 10i+3 instead, and thus include 13, 23 etc. I don't understand the last part of your comment with k mod...2017-01-02
  • 0
    The effect of what you are doing is to preselect numbers that are not divisible by $2$ or $5$ and are not $1 \bmod 5$. That will increase the density of acceptable primes in the numbers you test. You can do better still by making sure that the numbers you test are not multiples of $3$ or $7$ either, which is the point of my working $\bmod {210}$2017-01-02
  • 0
    @RossMillikan I understand what you're saying but looks too hard to implement, I mean with 2 and 5 alone I already have 3 forms of primes, whereas when before I had 3 instead of 5 it was only 6n-1 form alone.2017-01-02
  • 0
    Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/51081/discussion-between-ross-millikan-and-nae).2017-01-02

0 Answers 0