Help us understand the problem. What is going on with this article?

# Project Euler 46 「もうひとつのゴールドバッハの予想」

More than 1 year has passed since last update.

# Problem 46 「もうひとつのゴールドバッハの予想」

Christian Goldbachは全ての奇合成数は平方数の2倍と素数の和で表せると予想した.

9 = 7 + 2×1^2
15 = 7 + 2×2^2
21 = 3 + 2×3^2
25 = 7 + 2×3^2
27 = 19 + 2×2^2
33 = 31 + 2×1^2

```def hoge():
N = 33
while True:
N += 2 # 奇数なので+2ずつカウントアップ
# 合成数 = 素数ではない
if not is_prime(N) and \
not any(is_prime(N - n**2 * 2)
# 最小の平方数の2倍（2）をNから引いておく
for n in range(1, int(((N-2) / 2) ** 0.5) + 1)):
return N

def is_prime(n):
if n < 2: return False
if n == 2: return True
if n % 2 == 0: return False
return all(n % i != 0 for i in range(3, int(n ** 0.5) + 1, 2))

print(hoge())
```

Why not register and get more from Qiita?
1. We will deliver articles that match you
By following users and tags, you can catch up information on technical fields that you are interested in as a whole
2. you can read useful information later efficiently
By "stocking" the articles you like, you can search right away