728x90

소수

  • 이전
  • 1
  • 다음
백준

[백준] 4948번 파이썬

베르트랑 공준(Bertrand's postulate)이란 정수론에서 소수의 분포에 관한 정리이다. 정리에 따르면 두 정수 $n$과 $2n$ 사이에는 적어도 한 개의 소수가 존재 한다고 한다. 임의의 정수 $2 {\leq} n$에 대하여 $n

백준

[백준] 11653번 파이썬

11653번 - 소인수분해 import sys a = int(sys.stdin.readline()) s = 2 if a == 1: print("") while s

백준

[백준] 1929, 2581번 파이썬

1929, 2581번 - 소수 2581번 임의의 자연수 a이상 b이하 구간에 있는 소수 구하기 import sys a = int(sys.stdin.readline()) b = int(sys.stdin.readline()) number = [i for i in range(a, b+1)] pr_num = [] def is_prime(num): y = True if num == 2: y = True elif num

__name__
'소수' 태그의 글 목록
728x90