No BSD License  

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

Be the first to rate this file! 3 Downloads (last 30 days) File Size: 18.8 KB File ID: #5398

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

by Sundar Krishnan

 

02 Jul 2004 (Updated 08 Aug 2005)

Suite of 4 fns to find 2 groups of Positive Integers, whose Sum of Squares equals product of ?r? Pri

| Watch this File

File Information
Description

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.

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
24 Feb 2005

More meaningful Title given ; no change in the code

08 Aug 2005

Logic of find_the_2_Squares_from_the_Sum is changed.

Tag Activity for this File
Tag Applied By Date/Time
sum of squares Sundar Krishnan 22 Oct 2008 07:26:17
prime factors Sundar Krishnan 22 Oct 2008 07:26:17
product Sundar Krishnan 22 Oct 2008 07:26:17
prime factors Barry 03 Feb 2010 16:49:15

Contact us at files@mathworks.com