3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

数学雑談(僕が好きな素数の性質)

Posted at

以下の問題を解いてください

どんな言語でもいいです(初学者向け程度の難易度です)

問題

$x$, $y$が正の整数であるとき,
$2xy+x+y$の形で表すことができない正の整数を小さい順から$20$個列挙せよ.

解法例(Python)

numbers=[]

for i in range(1,50):#多分50個くらいやれば十分(適当)
    for j in range(1,i+1):
        numbers.append(2*i*j+i+j)

ans=[]

for i in range(1,10**5):#結構適当に
        if i in numbers:
            pass
        else:
            ans.append(i)
            if len(ans)==20:
                break
print(ans)

出力結果

[1, 2, 3, 5, 6, 8, 9, 11, 14, 15, 18, 20, 21, 23, 26, 29, 30, 33, 35, 36]

この数字の面白い性質

この数をすべて$2$倍してプラス$1$すると...

Pythonでやってみた


A=[1, 2, 3, 5, 6, 8, 9, 11, 14, 15, 18, 20, 21, 23, 26, 29, 30, 33, 35, 36]
ans=[]
for i in range(20):
    ans.append(2*A[i]+1)
print(ans)

結果

[3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73]

となります.

まとめ

これは実は奇素数の列挙となっています.

なぜか?はめんどくさいので書きませんが初見だと不思議で面白いと思いました.

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?