>

Dear Robin Garcia,

>

>Date: Tue, 30 Nov 2004 01:16:48 +0100 (CET)

> From: Robin Garcia <sopadeajo2001@...>

>Subject: a vey slow algorithm (enhanced)

>

>5 word 2:n=103:n1=n\4:clr time:dim A(n)

>6 for l=1 to n:A(l)=l*l:next l

>7 for o=1 to n1

>8 x=2*(2*o+1)

>10 if or{x=8,x=12,x=16} goto 85

>15 m=3:if x>=1426 m=5

>20 a=m:b=x\2:z=0

>30 for i=1 to a:g=A(i)

>40 for j=b-i to i step -1

>45 d=g+A(j):f=(x-i-j):e=f\2

>50 for k=i+1 to e

>60 if d=A(k)+A(f-k) z=z+1

>65 if z>0 cancel for,for,for:goto 85

>70 next k:next j:next i

>80 if z=0 c=c+1:print x\2;"es primo";prm(c+1);c+1

>85 next o

>86 print time

>90 end

>

>Line 20 incorporates a m parameter .All x<1426 have at least a solution

>n=a2+b2=c2+d2 with a<=3.Not x=1426 whose minimal a is 5.

>This answers the Cino question of why 143 is prime whith his program.

>x=2*143=286 has 34 n solutions and min (a,b,c,d) is 3.

>

>I do not know what is the distribution of min (a,b,c,d) for all x values.Parameter m should be changed depending on that.

>

>If you want a proof of the theorem ,see Sloane A092541

>

>

>---------------------------------

>

>

>ID Number: A092541 <http://www.research.att.com/projects/OEIS?Anum=A092541>

>URL: http://www.research.att.com/projects/OEIS?Anum=A092541

>Sequence <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/showtabl.cgi?A=A092541&format=4&height=1&seq=,50,65,85,125,130,170,185,221,250,305,325,338,425,410,425,481,578,610,725,650,697,905,850,845,925,1037,1066,1325,1258,1250,1313,1450,1445,1517,1586,1625,1810,2105,1885,2405,2050,2210,2210,2257,2465,2650,2525,2665>: 50,65,85,125,130,170,185,221,250,305,325,338,425,410,425,

> 481,578,610,725,650,697,905,850,845,925,1037,1066,1325,1258,

> 1250,1313,1450,1445,1517,1586,1625,1810,2105,1885,2405,2050,

> 2210,2210,2257,2465,2650,2525,2665

>Name: Minimal values of m=a^2+b^2=c^2+d^2 for each x=a+b+c+d (a,b,c,d

> positive integers).

>Comments: A general solution to m=a^2+b^2=c^2+d^2 for a known x=a+b+c+d is:

> c=(x(r-1)/2r)-a, d=(x+a(r-1))/(r+1) where r is a divisor of x/2. Thus

> x is always even.

> Theorem: a natural number p is prime if and only if there is never any

> m=a^2+b^2=c^2+d^2 for x=a+b+c+d=2p. Proof: Then r=p and

> d=(2p+a(p-1))/(p+1) which is impossible. x is even,x>=18 and x is

> never 2p (p=any prime). There are no other restrictions for the values

> of x. Thus this is an infinite sequence and is another proof that there

> are infinitely many primes of the form 4k+1. Proving that there are

> infinetely many values of x with minimal m being sum of 2 squares in less

> than 4 ways would be a proof that there are infinitely many primes of the

> form n^2+1 or 1/2(n^2*1)

>Formula: minimal m= (1/2) (t^2+1)((x/2t)^2+1) if t is the greatest factor of x/2

> <=floor(sqrt(x/2)) and t or x/2t are odd. Or minimal

> m=2(t^2+1)((x/4t)^2+1) if t is the greatest factor of x/2

> <=floor(sqrt(x/2)) and t and x/4t are even. Note that all minimal

> values are of the form 2^n(u^2+1)(v^2+1) n=-1 or 1

>Example: If x=28 minimal m= (1/2) (2^2+1)(7^2+1)=125

> If x=32 minimal m=2(4^2+1)(2^2+1)=170

> If x=96 m=2(6^2+1)(4^2+1)=1258

> If x=100 m= (1/2) (5^2+1)(10^2+1)=1313

>See also: Cf. A090073 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A090073> A091459 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A091459> A092357 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A092357>.

> Adjacent sequences: A092538 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A092538> A092539 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A092539> A092540 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A092540> this_sequence A092542 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A092542>

> A092543 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A092543> A092544 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A092544>

> Sequence in context: A062118 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A062118> A007692 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A007692> A025285 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A025285> this_sequence A039473 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A039473>

> A071366 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A071366> A045165 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A045165>

>Keywords: nonn,uned

>Offset: 1

>Author(s): Robin Garcia (verob99(AT)teleline.es), Apr 08 2004

>

I have submitted sequences based on True basic code to

Sloane's EOIS before and all I got was trouble

( they don't like using the space necessary for the listings).

I may be able to translate the code into True basic which is one of the

original Unix languages.

Is the progran Qbasic?

That is a really hard algorithm.

I have a friend who might be able to cut it down some.

It might be easier in Mathematica with it's list orientation.

I would welcome you as a poster in true number theory:

http://groups.yahoo.com/group/truenumber/

Number theory is also a more open group than the prime number group.

Respectfully, Roger L. Bagula

tftn@..., 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 :

alternative email: rlbtftn@...

URL : http://home.earthlink.net/~tftn