2
$\begingroup$

Related to Power of primes.

Let $p_n$ denote n-th prime and $\varphi$ the totient function.

For natural $n$, define $j(n)=\varphi(p_n+1-n)+1$.

For $n$ up to $10^9$ if $j(n) \equiv 19 \pmod {100}$ then $j(n)$ is prime. The computation took about 1 hour and 50 minutes.

Q1 How to explain this numerical result?

Q2 Does this hold for all $n$?

pari/gp code in case someones wants to test it.

{
test3(lim=10^2)=
/*
We avoid `prime(n)` for performance reasons
*/
default(primelimit,2*lim);
cou=0;coup=0;
n=2;
p=prime(n);
while(n<lim,
n += 1;
p=nextprime(p+1);
t=eulerphi(p+1-n)+1;
if(t%100==19,
    if(!isprime(t),print(" bad ",n);cou+=1;
    ,
    coup += 1);
);
);
return([cou,coup]);
}

$\endgroup$
6
  • $\begingroup$ Holds in the range $[10^{10}, 10^{10} + 10^6]$. It seems to still hold even if we don't subtract $n$ $\endgroup$ Commented Jan 21 at 17:04
  • $\begingroup$ $p$ being prime also doesn't seem necessary - at least in for $n \leq 10^6$, if $\phi(n) + 1 \pmod {100} \in \{19, 27, 35, 47, 67, 79, 87\}$ then it is prime. EDIT: 19 is eliminated at $n=1092725$ and 79 at $n=2476097$, and then 47 at $n=4782967$. The rest remain up to $10^7$. $\endgroup$ Commented Jan 21 at 17:10
  • $\begingroup$ From performance perspective, it's worth to replace isprime() function with ispseudoprime(). $\endgroup$ Commented Jan 21 at 17:26
  • $\begingroup$ In general for >99.9% of numbers $n \in [1, 10^7]$ (and there aren't a few of those, about 39,000) such that $\phi(n) + 1 \equiv 3 \pmod 4$ , $\phi(n) + 1$ is in fact prime. I'm not sure why. This holding exactly for some value $\mod 100$ doesn't seem that surprising given that, though. $\endgroup$ Commented Jan 21 at 17:33
  • 2
    $\begingroup$ @CommandMaster: $\phi(n)+1\equiv 3\pmod{4}$ implies that $n=4$ or $n=q^k$ or $n=2q^k$ for a prime $q\equiv 3\pmod{4}$. The case $k=1$ gives prime $\phi(n)+1=q$, while $k>1$ is much rarer (and can also occasionally give primes). Nothing is surprising here. $\endgroup$ Commented Jan 21 at 17:47

2 Answers 2

6
$\begingroup$

Using the observations in Max's answer, we can find an explicit counterexample: for $n = 19179214864, p_n = 496527469717$, we have $p_n + 1 - n = 477348254854 = 2 \cdot 6203^3$, and $\varphi(p_n + 1 - n) + 1 = 238635650219 = 23 \cdot 103 \cdot 100732651$. I used this SageMath code.

$\endgroup$
2
  • 1
    $\begingroup$ Wow, this is impressive computation, greatly optimized by Max's answer. I think this shows performance bug in pari. Confirming locally on sage on Linux. $\endgroup$
    – joro
    Commented Jan 22 at 10:18
  • 1
    $\begingroup$ @joro: it's not a bug. I believe superior performance in prime_pi is the result of primesieve/primecount used by Sage, but not by PARI. $\endgroup$ Commented Jan 22 at 15:46
9
$\begingroup$

Since $j(n)\equiv 19\pmod{100}$, we have $\varphi(p_n+1-n)\equiv 18\pmod{100}$ meaning that $\nu_2(\varphi(p_n+1-n))=1$. That is, $p_n+1-n$ is $q^k$ or $2q^k$ for a prime $q\equiv 3\pmod4$.

If $k=1$, then $j(n)=q$ is prime, and this is the case that you observe. A counterexample may exist only among those $n$ for which $p_n+1-n$ is $q^k$ or $2q^k$ with $k>1$ and $(q-1)q^{k-1}\equiv18\pmod{100}$, which tend to be rare (if any exists at all).

ADDED. Impossibility of $(q-1)q\equiv 3\pmod{5}$ rules out the case $k=2$.

In search for a counterexample, let $d:=p_n+1-n$. We want it to be of the form $q^k$ or $2q^k$ with $k>1$, $(q-1)q^{k-1}\equiv18\pmod{100}$, and number $\varphi(d)+1$ being composite. Leaving aside the question whether a suitable $n$ exists for a given value of $d$, the aforementioned conditions restrict the values of $d$ below $10^{10}$ to the set $S\cup 2S$ with $S:=\{103^3, 503^3, 1103^3, 1303^3, 79^5, 2003^3\}$. However, none of them gives a soluble $p_n+1-n=d$, and the chance of solubility is even smaller for larger $d$.

$\endgroup$
3
  • $\begingroup$ Can we heuristically estimate the probability that there is a counterexample? $\endgroup$ Commented Jan 22 at 8:13
  • $\begingroup$ If we set, for instance, $q \equiv 3 \pmod {100}, k = 3$, then for $q=3+100k$ there's a probability of around $\frac1{\log k}$ of it being prime, a probability of around $\frac1{\log k}$ that it's representable as such a $d$, and it's very likely that $(q-1)q^2 + 1$ is composite. $\sum \frac{1}{\log^2 k}$ is divergence (quite quickly, in fact), so it's likely there are infinitely many counterexamples. The problem is that checking for the existing of such a $d$ seems quite complex $\endgroup$ Commented Jan 22 at 8:21
  • $\begingroup$ Thanks. Your answer helped in counterexample in the other answer. $\endgroup$
    – joro
    Commented Jan 22 at 10:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .