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?

複素数の因数分解のパターン数

Last updated at Posted at 2025-04-09

image2x10.png
図1 約数の数

image2x10高レベル.png
図2 約数の有無

GaussianPrimeと吉原のOL.png
図3 ガウス素数(緑)の上に、約数の数(赤)をオーバーラップ

はじめに

複素数の素数は?
複素数の約数は?
複素数の因数分解は?
という、考えのもと、複素数の約数のパターン数を数え上げ、数に応じて可視化しました。
吉原さんの考えをもとに考案しています。
複素数の積(因数分解)として表すことができればそれを複素数の約数と捉えよう、という方針です。

環境

Processing 4.2
Complex Numbersライブラリ利用

プログラム

ダブりがあり、2重にカウントしてます。
力任せ、計算非効率なアルゴリズムです。
第一象限のみ計算。
Y軸反転。
軸上は計算なし。

Processing
import complexnumbers.*;

void setup() {
  size(50, 50);
  background(0);
  for (int y=1; y<=width; y++) {
    for (int x=1; x<=width; x++) {
      int count=0;
      Complex target;
      if (x<=y)
        target = new Complex(x, y);  // 目標の複素数
      else
        break;

      println("整数範囲 [-"+width+", "+width+"] で、(a + bi)(c + di) = "+x+"+"+y+"i となる組み合わせ:");

      for (int a = -width; a <= width; a++) {
        if (a==0) a++;
        for (int b = -width; b <= width; b++) {
          if (b==0) b++;
          Complex z1 = new Complex(a, b);

          for (int c = -width; c <= width; c++) {
            if (c==0) c++;
            for (int d = -width; d <= width; d++) {
              if (d==0) d++;
              Complex z2 = new Complex(c, d);
              Complex product = z1.mul(z2);
              if (product.equals(target)) {
                //println("("+z1+")("+z2+")");
                count++;
              }
            }
          }
        }
      }
      set(x, y, color(count*3));
      set(y, x, color(count*3));
      println(count);
    }
  }

  println("探索完了!");
}
x+yi=(a+bi)(c+di)

となるa,b,c,dの最大値はxまたはyを超えない、という前提で計算しています。

参考サイト

複素数の約数の総和(千葉県立船橋高等学校3年,吉原和志)

自分の

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?