Composite numbers $n$, such that every $a$ with $1<a<n-1$ is a witness

185 Views Asked by At

A Carmichael number $n$ has the property that

$$a^{n-1}\equiv 1\ (\ mod\ n\ )$$

for every $a$ with $(a,n)=1$.

I wonder, which numbers have the converse property :

For which composite numbers $n$, every number $a$ with $1<a<n-1$ is a witness ?

That means, for which composite numbers $n$ does $a^{n-1}\neq 1\ (\ mod\ n\ )$ hold for every $a=2,3,...,n-3,n-2$ ?

The numbers upto $200$ with this property are :

? for(n=2,200,if(isprime(n)==0,gef=1;for(a=2,n-2,if(Mod(a^(n-1),n)==1,gef=0));if
(gef==1,print1(n,"  "))))
4  6  8  9  10  12  14  16  18  20  22  24  26  27  30  32  34  36  38  40  42
44  46  48  50  54  56  58  60  62  64  68  72  74  78  80  81  82  84  86  88
90  92  94  96  98  100  102  104  106  108  110  114  116  118  120  122  126
128  132  134  136  138  140  142  144  146  150  152  156  158  160  162  164
166  168  170  174  178  180  182  184  188  192  194  198  200
?

The first few odd composite numbers with this property :

? forstep(n=3,2000,2,if(isprime(n)==0,gef=1;for(a=2,n-2,if(Mod(a^(n-1),n)==1,gef
=0));if(gef==1,print1(n,"  "))))
9  27  81  243  729

So, from the odd composite numbers, only the powers of $3$ seem to have this property.

The first few even composite numbers, NOT having this property :

? forstep(n=2,100,2,if(isprime(n)==0,gef=1;for(a=2,n-2,if(Mod(a^(n-1),n)==1,gef=
0));if(gef==0,print1(n,"  "))))
28  52  66  70  76