일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- 알고리즘 분석의 실례
- 일차변환
- 빅세타
- recursive algorithms
- Big-Oh 예제
- one-to-one
- 코틀린 Hello World!
- homogeneous linear system
- matrix trnasformations
- Big Omega
- 재귀함수
- 랜덤 순서 배열
- 배열 섞기
- python
- NumPy
- Big-O 예제
- 이진 탐색
- trivial solution
- linear dependence
- 빅오 표기법
- nontrivial solution
- 코틀린 시작하기
- matrix fo a linear transformation
- Big Theta
- 빅오메가
- Big-Oh notation
- nonhomogeneous linear system
- matrix-vector product
- itertools
- solutions of matrix equation
- Today
- Total
목록project euler with python (53)
코딩 연습
A number consisting entirely of ones is called a repunit. We shall define \(R(k)\) to be a repunit of length \(k\); for example, \(R(6)=111111\). Given that \(n\) is a positive integer and \({\rm GCD}(n, \;10)=1\), it can be shown that there always exists a value, \(k\), for which \(R(k)\) is divisible by \(n\), and let \(A(n)\) be the least such value of \(k\); for example, \(A(7)=6\) and \(A(4..
A number consisting entirely of ones is called a repunit. We shall define \(R(k)\) to be a repunit of length \(k\); for example \(R(6)=111111\). Given that \(n\) is positive integer and \({\rm GCD}(n, \;10) =1\), it cane be shown that there always exists a value, \(k\), for which \(R(k)\) is divisible by \(n\), and let \(A(n)\) be the least such value of \(k\); for example, \(A(7)=6\) and \(A(41..
A hexagonal tile with number \(1\) is surrounded by a ring of six hexagonal tiles, starting at "12 o'clock" and numbering the tiles \(2\) to \(7\) in an anti-clockwise direction. New rings are added in the same fashion, with the next ring being numbered \(8\) to \(19\), \(20\) to \(37\), \(38\) to \(61\), and so on. The diagram below shows the first three rings. By finding the difference between..
The radical of \(n\), \({\rm rad}(n)\), is the product of distinct prime factors of \(n\). For example, \(504=2^3 \times 3^2 \times 7\), so \({\rm rad}(504)=2 \times 3 \times 7 = 42\). We shall define the triplet of positive integers \((a, \;b,\;c)\) to be an abc-hit if: 1. \({\rm GCD}(a, \;b)={\rm GCD}(a, \;c) = {\rm GCD}(b, \;c)=1\) 2. \(a
The minimum number of cubes to cover every visible face on a cuboid measuring \(3 \times 2 \times 1\) is twenty-two. If we then add a second layer to this solid it would require forty-six cubes to cover every visible face, the third layer would require seventy-eight cubes, and the fourth layer would require one hundred and eighteen cubes to cover every visible face. However, the first layer on a..
The palindromic number 595 is interesting because it can be written as the sum of consecutive squares: \(6^2 + 7^2 + 8^2 +9^2 + 10^2 + 11^2 + 12^2\). There are exactly eleven palindromes below one-thousand that can be written as consecutive square sums, and the sum of these palindromes is \(4164\). Note that \(1 = 0^2 + 1^2\) has not been included as this problem is concerned with the squares of..
The radical of \(n\), \({\rm rad}(n)\), is the product of the distinct prime factors of \(n\). For example, \(504 = 2^3 \times 3^2 \times 7\), so \({\rm rad}(504) = 2 \times 3 \times 7 =42\). If we calculate \({\rm rad}(n)\) for \(1 \le n \le 10\), then sort them on \({\rm rad}(n)\), and sorting on \(n\) if the radical values are equal, we get: Unsorted Sorted \(n\) \({\rm rad}(n)\) \(n\) \({\rm..
Let \(p_n\) be the \(n\)th prime : \(2,\; 3,\; 5,\; 7,\; 11,\; \cdots,\) and let \(r\) be the remainder when \((p_n -1)^n + (p_n +1)^n\) is divided by \(p_n ^2\). For example, when \(n=3, \; p_3 = 5\), and \(4^3 + 6^3 = 280 \equiv 5\) mod \(25\). The least value of \(n\) for which the remainder first exceeds \(10^9\) is \(7037\). Find the least value of \(n\) for which the remainder first exceed..
The most naive way of computing \(n^{15}\) requires fourteen multiplications: \[ n \times n \times \cdots \times n = n^{15}\] But using a "binary" method you can compute it is six multiplications: \[\begin{split} n \times n &= n^2 \\ n^2 \times n^2 &= n^4 \\ n^4 \times n^4 &= n^8 \\ n^8 \times n^4 &= n^{12} \\ n^{12} \times n^2 &= n^{14} \\ n^{14} \times n &= n^{15} \end{split}\]However it is ye..
A bag contains one red disc and one blue disc. In a game of chance a player takes a disc at random and its color is noted. After each turn the disc is returned to the bag, an extra red disc is added, and another disc is taken at random. The player pays £1 to play and wins if they have taken more blue discs than red discs at the end of the game. If the game is played for four turns, the probabili..