Skip to content

Instantly share code, notes, and snippets.

View junichiro's full-sized avatar

Junichiro Tobe junichiro

  • Novasell
  • Tokyo, Japan
View GitHub Profile
@junichiro
junichiro / file0.txt
Created February 2, 2018 02:03
会社で少し盛り上がった Project Euler をやってみる 010 ref: https://qiita.com/junichiro/items/8503e979d0314e7f2486
10以下の素数の和は 2 + 3 + 5 + 7 = 17 である.
200万以下の全ての素数の和を求めよ.
@junichiro
junichiro / file0.txt
Created February 1, 2018 03:24
会社で少し盛り上がった Project Euler をやってみる 009 ref: https://qiita.com/junichiro/items/51d23139d469d1196c2e
a^2 + b^2 = c^2
@junichiro
junichiro / file0.txt
Created January 31, 2018 00:37
会社で少し盛り上がった Project Euler をやってみる 008 ref: https://qiita.com/junichiro/items/f74ed645511c9520b9e9
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
66896648950445244523161731856403098711121722383113
62229893423380308135336276614282806444486645238749
30358907296290491560440772390713810515859307960866
70172427121883998797908792274921901699720888093776
65727333001053367881220235421809751254540594752243
52584907711670556013604839586446706324415722155397
@junichiro
junichiro / file0.txt
Created January 30, 2018 02:30
会社で少し盛り上がった Project Euler をやってみる 007 ref: https://qiita.com/junichiro/items/ca842ce0402c2d77463f
class Problem7:
LIMIT = 10001
PRIME = []
def main(self):
i = 1
while(len(self.PRIME) < self.LIMIT):
i = i + 1
if self.isPrime(i):
@junichiro
junichiro / file0.txt
Last active January 29, 2018 03:22
会社で少し盛り上がった Project Euler をやってみる 006 ref: https://qiita.com/junichiro/items/3201fc90cbb87e339329
class Problem6:
LIMIT = 100
def main(self):
l = range(1, self.LIMIT + 1)
print((sum(l) ** 2) - (sum(i * i for i in l)))
if __name__ == '__main__':
@junichiro
junichiro / file0.txt
Last active January 30, 2018 02:32
会社で少し盛り上がった Project Euler をやってみる 005 ref: https://qiita.com/junichiro/items/96f5ee0f5eb85da66812
2520 は 1 から 10 の数字の全ての整数で割り切れる数字であり, そのような数字の中では最小の値である.
では, 1 から 20 までの整数全てで割り切れる数字の中で最小の正の数はいくらになるか.
@junichiro
junichiro / file0.txt
Last active January 25, 2018 03:22
会社で少し盛り上がった Project Euler をやってみる 004 ref: https://qiita.com/junichiro/items/4a2f55c39b068a7f491f
class Problem4:
def main(self):
palindromeNumber = 0
for i in range(100, 1000):
for j in range(i, 1000):
num = i * j
if self.isPalindromeNumber(num):
if num > palindromeNumber:
palindromeNumber = num
@junichiro
junichiro / file0.txt
Last active January 30, 2018 02:33
会社で少し盛り上がった Project Euler をやってみる 003 ref: https://qiita.com/junichiro/items/5e2ee2c6fc5a3fcd2460
13195 の素因数は 5, 7, 13, 29 である.
600851475143 の素因数のうち最大のものを求めよ.
@junichiro
junichiro / file0.txt
Last active January 23, 2018 01:49
会社で少し盛り上がった Project Euler をやってみる 002 ref: https://qiita.com/junichiro/items/97a85bcedaae08a55896
フィボナッチ数列の項は前の2つの項の和である. 最初の2項を 1, 2 とすれば, 最初の10項は以下の通りである.
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
数列の項の値が400万以下の, 偶数値の項の総和を求めよ.
@junichiro
junichiro / file0.txt
Last active January 23, 2018 01:53
会社で少し盛り上がった Project Euler をやってみる 001 ref: https://qiita.com/junichiro/items/6f75a14b9ebaf7298853
10未満の自然数のうち, 3 もしくは 5 の倍数になっているものは 3, 5, 6, 9 の4つがあり, これらの合計は 23 になる.
同じようにして, 1000 未満の 3 か 5 の倍数になっている数字の合計を求めよ.