Find numbers which can be expressed as Sum of Squares of Positive Integers

Suite of 4 fns to find 2 groups of Positive Integers, whose Sum of Squares equals product of ?r? Pri
ダウンロード: 1.4K
更新 2005/8/8

ライセンスがありません

First, some examples :
17 * 29 * 41 * 149 * 113 = 340326281
= 2984^2 + 18205^2 = 18220^2 + 2891^2

509 * 853 * 769 = 333882113
= 11528^2 + 14177^2 = 18272^2 + 127^2

The Main programme is the subfunction Test_Random_2_Squares within the function : Runs_Of_Test_Random_2_Squares_1.m which tries to find 2 sets of arrays of positive integers such that the corresponding sums of squares of the numbers in the 2 arrays equals the product of r no of Prime Factors.

The function : find_the_2_Squares_from_the_Sum ( Sum ) forms the heart of this suite, which can also be independently used.

Whereas, currently (Aug 2005), the top function : Runs_Of_Test_Random_2_Squares_1.m
deals only with prime factors of the form (4*n+1), the heart-function : fnd_the_2_Squares_from_the_Sum.m can still be independently used to find sum of squares - even if the factors include primes of type (4*n-1), or even 2.

The various steps of the subfunction Test_Random_2_Squares.m are :

1) This overall pgm first calls Prime_Fctrs_Of_Sum_Of_2_Sqrs(N)
to obtain the list of primes which are <= N, and which are of the form (4n+1).

2) Next, it randomly chooses "r" nos from the output primes_N_4nPlus1 of the above call.

3) Next, it calls [ Match_Rnded_Array_1, Match_Rnded_Array_2 ] =
find_the_2_Squares_from_the_Sum(Sum) ;
to get the 2 sets of arrays.

*************

There are some open queries given in find_the_2_Squares_from_the_Sum ( Sum ), the answers to which will help us understand this concept better.
Thanks in advance to those who are sending clarifications.

引用

Sundar Krishnan (2024). Find numbers which can be expressed as Sum of Squares of Positive Integers (https://www.mathworks.com/matlabcentral/fileexchange/5398-find-numbers-which-can-be-expressed-as-sum-of-squares-of-positive-integers), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R14
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersDiscrete Math についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0

Logic of find_the_2_Squares_from_the_Sum is changed.