Program Tong_nguyen_to; Var i,n:integer; Function NT(n:integer):Boolean; Var ok: Boolean; i:integer; Begin ok:=true; For i:=2 to n-1 do if (n mod i) = 0 then ok:=ok and false; if n>=2 then NT:=ok else NT:=false; End; Begin Write('Nhap so n: ');Readln(n); For i:=2 to n div 2 do if (NT(i) and NT(n-i)) then Writeln(n,' = ',i,' + ',n-i); Readln
- Xét xem trong đoạn [n1...n2] số nào cho phép tách thành tổng hai số nguyên tố nhiều trường hợp nhất.
- Tách một số thành tổng ba số nguyên tố.