코드 c풀이 페르마의 소정리와 카마이클 수를 이용한 문제이다. 아래 위키피디아 문서를 참고한다면 생각보다 쉽게 풀 수 있다.
Carmichael number - Wikipedia Carmichael number 24 languages Article Talk Read Edit View history Tools From Wikipedia, the free encyclopedia In number theory , a Carmichael number is a composite number n , which in modular arithmetic satisfies the congruence relation : b n ≡ b ( mod n ) for all integers b . [1] The relation may ... en.wikipedia.org Fermat's little theorem - Wikipedia Fermat's little theorem 50 languages Articl...
원문 링크 : [백준/Python] (P5) 가짜 소수 - 13319