Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- Python
- 딥러닝
- 전처리
- 신경망
- backpropagation
- deep learning
- Convolutional Neural Network
- neural network
- A Neural Algorithm of Artistic Style
- c#
- 소인수분해
- 역전파법
- bayesian
- 오토인코더
- SQL
- mnist
- 히토요시
- 냥코 센세
- Autoencoder
- 합성곱 신경망
- CNN
- Gram matrix
- 오일러 프로젝트
- 소수
- 자전거 여행
- 비샤몬당
- 수달
- 역전파
- project euler
- 베이지안
Archives
- Today
- Total
통계, IT, AI
41. Pandigital prime 본문
1. 개요
문제는 이곳에서 확인할 수 있다. 어떤 수의 각 자리수가 1부터
2. 구현
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # -*- coding: utf-8 -*- import math max_int = 7654321 # for 7654321 is_prime = bytearray([ 1 ]) * (max_int + 1 ) is_prime[ 0 ] = is_prime[ 1 ] = 0 for p in range ( 2 , int (math.sqrt(max_int)) + 1 ): if is_prime[p]: m = max_int / / p - p + 1 is_prime[p * p::p] = bytearray([ 0 ]) * m for p in range (max_int, 0 , - 1 ): if is_prime[p]: set_p = str (p) if set ([ int (s) for s in set_p]) = = set ( range ( 1 , len (set_p) + 1 )): print ( 'ANSWER: {p}' . format (p = p)) break |
답은 7652413이다.
'IT > PROJECT_EULER' 카테고리의 다른 글
[Project Euler] 43. Sub-string divisibility (0) | 2017.05.01 |
---|---|
42. Coded triangle numbers (0) | 2017.04.30 |
40. Champernowne's constant (0) | 2017.04.26 |
39. Integer right triangles (0) | 2017.04.23 |
38. Pandigital multiples (0) | 2017.04.22 |