Trong ly thuyet so, so gia nguyen to (tieng Anh: pseudoprime) la mot so nguyen to xac suat (tieng Anh: probable prime ) nhung khong phai la so nguyen to. Mot so tu nhien thoa man mot tinh chat nao đo cua cac so nguyen to co the la so nguyen to voi mot xac suat nao đo. Con so gia nguyen to la cac hop so thoa man tinh chat đo. Tuy theo tinh chat ma no thoa man, ta se co cac loai so gia nguyen to khac nhau. Nen phan biet ro so nguyen to xac suat va so gia nguyen to. So nguyen to xac suat co the la nguyen to cung co the la hop so (voi xac suat khac nhau).


So gia nguyen to Fermat = Đinh nghia =
Đinh ly nho Fermat khang đinh voi moi so nguyen to p va moi so tu nhien a; ta co: 

  
    
      
        
          a
          
            p
          
        
        ≡
        a
        
          
          (
          mod
          
          p
          )
        
      
    
    {\displaystyle a^{p}\equiv a{\pmod {p}}}
  
.
Neu menh đe tuong tu đung voi so tu nhien n va voi so a nao đo:

  
    
      
        
          a
          
            n
          
        
        ≡
        a
        
          
          (
          mod
          
          n
          )
        
      
    
    {\displaystyle a^{n}\equiv a{\pmod {n}}}
  

thi n đuoc goi la so nguyen to xac suat Fermat co so a. Neu n la hop so thi no đuoc goi la so gia nguyen to Fermat co so a.


= Vi du =
So n=561=3.11.17 la mot hop so. Lay a=2. Ta co

  
    
      
        
          2
          
            560
          
        
        =
        
          4
          
            280
          
        
        ≡
        1
        
          
          (
          mod
          
          3
          )
        
      
    
    {\displaystyle 2^{560}=4^{280}\equiv 1{\pmod {3}}}
  
; 
  
    
      
        
          2
          
            560
          
        
        =
        
          
            
              (
              
                2
                
                  10
                
              
              )
            
          
          
            56
          
        
        ≡
        1
        
          
          (
          mod
          
          11
          )
        
      
    
    {\displaystyle 2^{560}={\left(2^{10}\right)}^{56}\equiv 1{\pmod {11}}}
  
 va 
  
    
      
        
          2
          
            560
          
        
        =
        
          
            
              (
              
                2
                
                  16
                
              
              )
            
          
          
            35
          
        
        ≡
        1
        
          
          (
          mod
          
          17
          )
        
      
    
    {\displaystyle 2^{560}={\left(2^{16}\right)}^{35}\equiv 1{\pmod {17}}}
  
. Tu đo 
  
    
      
        
          2
          
            560
          
        
        ≡
        1
        
          
          (
          mod
          
          561
          )
        
      
    
    {\displaystyle 2^{560}\equiv 1{\pmod {561}}}
  
. Do đo 561 la so gia nguyen to Fermat co so 2.


= Mot so ket qua =
Neu n la so gia nguyen to co so 2 thi 
  
    
      
        m
        =
        
          2
          
            n
          
        
        −
        1
      
    
    {\displaystyle m=2^{n}-1}
  
 cung la so gia nguyen to co so 2. Tu đo suy ra co vo han so gia nguyen to co so 2.
So Carmichael: Hop so n la so Carmichael neu no la so gia nguyen to Fermat voi moi co so a sao cho UCLN(a,n)=1.Vi du so 561 o tren la so Carmichael.


So gia nguyen to (Fermat) manh = Đinh nghia =
Trong đong du thuc cua đinh ly nho Fermat voi so nguyen to le p va so tu nhien a khong chia het cho p

  
    
      
        
          a
          
            p
            −
            1
          
        
        ≡
        1
        
          
          (
          mod
          
          p
          )
        
      
    
    {\displaystyle a^{p-1}\equiv 1{\pmod {p}}}
  
.
ta phan tich so chan 
  
    
      
        p
        −
        1
        =
        
          2
          
            s
          
        
        ⋅
        m
      
    
    {\displaystyle p-1=2^{s}\cdot m}
  
, voi m la so le.
Khi đo 

hoac 
  
    
      
        
          a
          
            m
          
        
        ≡
        1
        
          
          (
          mod
          
          p
          )
        
      
    
    {\displaystyle a^{m}\equiv 1{\pmod {p}}}
  
; (1)
hoac 
  
    
      
        
          a
          
            
              2
              
                k
              
            
            ⋅
            m
          
        
        ≡
        −
        1
        
          
          (
          mod
          
          p
          )
        
      
    
    {\displaystyle a^{2^{k}\cdot m}\equiv -1{\pmod {p}}}
  
 voi k nao đo 
  
    
      
        ∈
      
    
    {\displaystyle \in }
  
 {0,1,..,s}. (2)
So tu nhien le n trong đo 
  
    
      
        n
        −
        1
        =
        
          2
          
            s
          
        
        ⋅
        m
      
    
    {\displaystyle n-1=2^{s}\cdot m}
  
 thoa man 
  
    
      
        
          a
          
            m
          
        
        ≡
        1
        
          
          (
          mod
          
          n
          )
        
      
    
    {\displaystyle a^{m}\equiv 1{\pmod {n}}}
  
 hoac ton tai k 
  
    
      
        ∈
      
    
    {\displaystyle \in }
  
 {0,1,..,s} sao cho 
  
    
      
        
          a
          
            
              2
              
                k
              
            
            ⋅
            m
          
        
        ≡
        −
        1
        
          
          (
          mod
          
          m
          )
        
      
    
    {\displaystyle a^{2^{k}\cdot m}\equiv -1{\pmod {m}}}
  
 đuoc goi la so nguyen to xac suat manh Fermat co so a, neu n la hop so thi n đuoc goi la so gia nguyen to Fermat co so a.
So gia nguyen to manh đuoc su dung đe kiem tra tinh nguyen to theo xac suat trong kiem tra Miller-Rabin.


= Mot so ket qua =
Moi so gia nguyen to manh Fermat đeu la so gia nguyen to Fermat.
Neu n < 4.759.123.141 la hop so thi n khong the la gia nguyen to manh đong thoi voi ba co so a = 2, 7, va 61 (Jaeschke-1993).
Neu n < 341.550.071.728.321 la hop so thi n khong đong thoi la gia nguyen to manh Fermat voi bay co so a = 2, 3, 5, 7, 11, 13, 17 (Jaeschke-1993).
So nguyen to xac suat Fermat manh đuoc su dung trong kiem tra Miller-Rabin đe kiem tra tinh nguyen to theo xac suat cua so tu nhien le n.


So gia nguyen to Euler Đinh ly Fermat khang đinh voi moi so nguyen to p va moi so a:

  
    
      
        
          a
          
            p
            −
            1
          
        
        ≡
        1
        
          
          (
          mod
          
          p
          )
        
      
    
    {\displaystyle a^{p-1}\equiv 1{\pmod {p}}}
  
.
Neu p la so nguyen to le, tu đo co

  
    
      
        
          a
          
            
              
                p
                −
                1
              
              2
            
          
        
        ≡
        ±
        1
        
          
          (
          mod
          
          p
          )
        
      
    
    {\displaystyle a^{\frac {p-1}{2}}\equiv \pm 1{\pmod {p}}}
  
.


= Đinh nghia =
So tu nhien le n thoa man đong du thuc tuong tu voi mot a nao đo:

  
    
      
        
          a
          
            
              
                n
                −
                1
              
              2
            
          
        
        ≡
        ±
        1
        
          
          (
          mod
          
          n
          )
        
      
    
    {\displaystyle a^{\frac {n-1}{2}}\equiv \pm 1{\pmod {n}}}
  
.
đuoc goi la so nguyen to xac suat Euler, neu n la hop so thi n duoc goi la so gia nguyen to Euler.


= Cac ket qua =
Moi so gia nguyen to Euler co so a đeu la so gia nguyen to Fermat co so a.


So gia nguyen to Euler-Jacobi = Đinh nghia =
Đinh ly Euler (Con goi la tieu chuan Euler) khang đinh voi moi so nguyen to p va moi so a:

  
    
      
        
          a
          
            
              
                p
                −
                1
              
              2
            
          
        
        ≡
        
          (
          
            
              a
              p
            
          
          )
        
        
          
          (
          mod
          
          p
          )
        
      
    
    {\displaystyle a^{\frac {p-1}{2}}\equiv \left({\frac {a}{p}}\right){\pmod {p}}}
  
.
trong đo 
  
    
      
        
          (
          
            
              a
              p
            
          
          )
        
      
    
    {\displaystyle \left({\frac {a}{p}}\right)}
  
 la ky hieu Legendre.
Ky hieu Legendre chi đuoc đinh nghia cho so nguyen to p. Khi mo rong ky hieu Legendre cho so tu nhien le n va so tu nhien a ta co ky hieu Jacobi đuoc ky hieu giong nhu ky hieu Legendre:

  
    
      
        
          (
          
            
              a
              n
            
          
          )
        
      
    
    {\displaystyle \left({\frac {a}{n}}\right)}
  
.
So tu nhien le n thoa man đong du thuc tuong tu đinh ly Euler:

  
    
      
        
          a
          
            
              
                n
                −
                1
              
              2
            
          
        
        ≡
        
          (
          
            
              a
              n
            
          
          )
        
        
          
          (
          mod
          
          n
          )
        
      
    
    {\displaystyle a^{\frac {n-1}{2}}\equiv \left({\frac {a}{n}}\right){\pmod {n}}}
  
.
voi a nao đo đuoc goi la so nguyen to xac suat Euler-Jacobi co so a. Neu n la hop so thoa man đong du thuc tren no đuoc goi la so gia nguyen to Euler-Jacobi co so a.


= Cac ket qua =
Moi so gia nguyen to Euler-Jacobi co so a đeu la so gia nguyen to Euler co so a.
Moi so gia nguyen to Fermat manh co so a đeu la so gia nguyen to Euler-Jacobi.
Moi so gia nguyen to Euler-Jacobi co so a thoa man mot trong hai đieu kien sau la so gia nguyen to manh co so a:

  
    
      
        n
        ≡
        3
        
          
          (
          mod
          
          4
          )
        
      
    
    {\displaystyle n\equiv 3{\pmod {4}}}
  
;
Ky hieu Jacobi 
  
    
      
        
          (
          
            
              a
              n
            
          
          )
        
        =
        −
        1
      
    
    {\displaystyle \left({\frac {a}{n}}\right)=-1}
  

Cac so nguyen to xac suat Euler-Jacobi đuoc su dung trong kiem tra Solovay-Strassen đe kiem tra tinh nguyen to theo xac suat.


Tham khao Lien ket ngoai Pseudoprimes up to 15.999 Luu tru ngay 21 thang 3 nam 2005 tai Wayback Machine