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?

ラマヌジャンの魔方陣を作ってみる

3
Last updated at Posted at 2025-12-24

ラマヌジャンってだれ

こちらをご覧ください。

普通にやってみる

今回は日付を「2011916日」とします。
そして変数$a$を16, $b$を9, $c$を20, $d$を11とします。

そして、マスをこんな感じにします。

1列目 2列目 3列目 4列目
$a$ $b$ $c$ $d$
$d+1$ $c-1$ $b-3$ $a+3$
$b-2$ $a+2$ $d+2$ $c-2$
$c+1$ $d-1$ $a+1$ $b-1$

すると自動的に、縦 + 横 + 斜めのどの方向でも足せば
合計が同じになります!

作ったもの

日付から魔方陣が作れるというものです。


プログラミングは数学にも役立つ!
最後まで読んでいただきありがとうございます。

3
0
1

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?