0
1

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.

メモ:完全数と2進数

Last updated at Posted at 2020-12-15

完全数を2進数表現すると

10進 2進 対応素数
6 11 0 $3 = 2^2-1$
28 111 00 $7 = 2^3-1$
496 1 1111 0000 $31 = 2^5-1$
8128 111 1111 00 0000 $127 = 2^7-1$
33550336 1 1111 1111 1111 0000 0000 0000 $8191 = 2^{13}-1$
8589869056 1 1111 1111 1111 1111 0000 0000 0000 0000 $131071 = 2^{17}-1$
... ... ...

なので、完全数の(自身を除く)約数は「素数となる $\left( 2^m-1 \right)$」と「$2^n \left[ n:0,1, \cdots, \left( m-1 \right) \right]$」の組み合わせで、約数の総和が完全数になることが、シフト演算($2^n$ の約数は 2 のみ)のお陰で直感的にわかる。「496」を例にすると

10進 2進(A) 2進(B)
$1 \times 496$ 1 1 1111 0000
$2 \times 248$ 10 1 1111 000
$4 \times 124$ 100 1 1111 00
$8 \times 62$ 1000 1 1111 0
$16 \times 31$ 10000 1 1111

列(A) の総和 $31_{10進} = 11111_{2進}$ に、列(B) の下から順に加えていくと、左シフト操作の連続になります。上から二番目まで加えたら、一番上と同じになります。値を気にせず 0,1 の並びを操作する感じになります。

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?