Subject: I don't know how to solve junior high school math problems, AI...

Author: renchao (A Chao)

Level 1:

Reputation: 100

Forum: topic development data structure and Algorithm

Problem count: 20

Reply times: 48

Posting time: 8:22:00

A is rational number, A * A + 5 and a * A-5 are rational number of square, ask a is how much?

Top

Reply to: mathe () (one star (intermediate) Credit: 105 12:36:50 score: 10

?

Let

U and v meet the following requirements:

U ^ 4-v ^ 4 = 5w ^ 2

Let B = 2 * u ^ 2 * V ^ 2, c = u ^ 4-v ^ 4, D = u ^ 4 + V ^ 4, then

B ^ 2 + C ^ 2 = d ^ 2

(B + C) ^ 2 + (B-c) ^ 2 = 2D ^ 2

And 10 BC is the total number of shards,

A ^ 2 = 4bc/(10d ^ 2)

Is a solution.

For example

U = 3, V = 1, W = 4, B = 18, c = 80, D = 82

A ^ 2 = 4*18*80/(10*82 ^ 2), both a = 12/41

Top

Reply to: mathe () (one star (intermediate) Credit: 105 12:41:07 score: 0

?

There are two cases:

25u ^ 4-v ^ 4 = w ^ 2

B = 10u ^ 2v ^ 2, c = w ^ 2, D = 25u ^ 4 + V ^ 4

A ^ 2 = 4bc/(10d ^ 2)

And

U ^ 4-25v ^ 4 = w ^ 2

B = 10u ^ 2v ^ 2, c = w ^ 2, D = u ^ 4 + 25v ^ 4

A ^ 2 = 4bc/(10d ^ 2)

Top

Reply to: mathe () (one star (intermediate) Credit: 105 12:48:15 score: 0

?

In the first case, three groups can be found on the computer at 1 <= V <u <= 100

U = 3, V = 1

U = 5, V = 2

U = 49, V = 31

Top

Reply to: mathe () (one star (intermediate) Credit: 105 12:53:49 score: 0

?

In the second case, the solution cannot be found when u <100

In the third case, you can find the solution when u is less than 100.

U = 41, V = 12

Top

Reply to: mathe () (one star (intermediate) Credit: 105 13:02:43 score: 0

?

Case 1:

U = 3, V = 1, A = 48/41

U = 5, V = 2, A = 2420/641.

U = 49, V = 31, A = 1470780864/3344161.

Case 3:

U = 41, V = 12, A = 2270443224/3344161.

Top

Reply to: mathe () (one star (intermediate) Credit: 105 13:21:34 score: 0

?

U = 5, V = 2 this group of solutions is wrong, my program forgot to judge U % 5! = 0.

And a ^ 2 = (10d ^ 2/4bc). I got it wrong.

U = 3, V = 1, W = 4, A = 41/12

U = 49, V = 31, W = 984, A = 3344161/1494696

Case 3:

U = 41, V = 12, A = 3344161/1494696.

Top

Reply to: mathe () (one star (intermediate) Credit: 105 13:46:15 score: 0

?

It seems that a = x/y is the first solution:

U = x, V = Y is a third solution.

For example

Take U = 3344161, V = 1494696, W = SQRT (U ^ 4-25 * V ^ 4) = 535583225279

D = 249850594047271558364480641

A = 2 * u * V/D = 5354229862821602092291248/249850594047271558364480641

:)

Top

Reply to: mathe () (one star (intermediate) Credit: 105 13:53:57 score: 0

?

Right, now prove:

A = x/y is a group of solutions, so u = x, V = Y is a group of 3rd solutions.

Proof:

A ^ 2 + 5 indicates the number of workers and a ^ 2-5 indicates the number of workers.

So (x ^ 2 + 5y ^ 2)/y ^ 2, (x ^ 2-5y ^ 2)/y ^ 2 are the number of samples.

Assume that x ^ 2 + 5y ^ 2 = Z ^ 2, x ^ 2-5y ^ 2 = w ^ 2

So the two formula is multiplied to get x ^ 4-25y ^ 4 = (ZW) ^ 2.

Therefore, (u, v) = (X, Y) is a solution for 3rd cases.

In this way, we can obtain the solution of an = x (n)/Y (n) without an array)

X (0) = 41, y (0) = 12

W (n + 1) = SQRT (x (n) ^ 4-25y (n) ^ 4)

X (n + 1) = 2 * x (n) * Y (n) * w (n + 1)

Y (n + 1) = x (n) ^ 4 + 25 * Y (n) ^ 4

Top

Reply to: mathe () (one star (intermediate) Credit: 105 14:07:59 score: 0

?

Now, let's introduce my ideas.

First, assume a = x/y (X, Y is the two positive integers of the reciprocal)

A ^ 2 + 5, a ^ 2-5 is the number of shards of rational numbers, that is

X ^ 2 + 5y ^ 2, x ^ 2-5y ^ 2

It is also the number of Integers

Hypothesis

X ^ 2 + 5y ^ 2 = s ^ 2 (1)

X ^ 2-5y ^ 2 = t ^ 2 (2)

So

S ^ 2 + t ^ 2 = 2 * x ^ 2

It is easy to see that S and T must be the same as parity. Then we can calculate

(S + T)/2) ^ 2 + (S-T)/2) ^ 2 = x ^ 2, so (S + T)/2, (s-t)/2, X constitutes the number of hooks.

Note B = (S-T)/2, c = (S + T)/2, D = x, and bring (1)-(2) to get

10y ^ 2 = 4bc

Therefore, 4bc/10 is the number of complete records y.

For the number of shares (B, c, d), we are only interested in their mutual elements (otherwise, we can make them

The result is the same after dividing by the common number ),

Therefore, we are only interested in the situation of B and C, at this time, we also require 10 BC to be a full number of samples.

The number of mutual elements (B, c, d) can always be written:

B = 2EF, c = e ^ 2-F ^ 2, D = e ^ 2 + f ^ 2 (and (e, f) = 1, E, F has an even number)

10bc is the number of complete elements, B, and C, which indicates that all elements of B and C except 2 and 5 are even.

C is an odd number, and there are only two possible cases:

I) 2B is the number of workers, 5C is the number of workers:

Corresponds to E = u ^ 2, F = V ^ 2, u ^ 4-v ^ 4 = 5w ^ 2

Ii) 10b is the worker number, and C is the Worker Number:

There are two scenarios:

A) E = 5u ^ 2, F = V ^ 2, 25u ^ 4-v ^ 4 = w ^ 2

B) E = u ^ 2, F = 5 V ^ 2, u ^ 4-25v ^ 4 = w ^ 2

It seems that the last case is best to use :)

Top

Reply to: mathe () (one star (intermediate) Credit: 105 15:29:19 score: 0

?

Haha, try to use Perl to calculate the first few:

#! /Usr/bin/perl

Use bigint;

$ X = 41; $ Y = 12;

For ($ I = 0; $ I <5; $ I ++ ){

Print $ X. "/". $ Y. "/N ";

$ X4 = $ x * $ X;

$ Y4 = $ y * $ Y;

$ W = SQRT ($ x4-25 * $ Y4 );

$ Y = 2 * $ x * $ y * $ W;

$ X = $ X4 + 25 * $ Y4;

}

Printf $ X. "/". $ Y. "/N ";

41/12

3344161/1494696

249850594047271558364480641/5354229862821602092291248

3896941041458487485320832722469963686366256264486004169772710584821176712668535259971051251201565099266561/167019439477564254804819333692197516475269570978824403519721702282259070147808848039273138602363503527584

230638590010706539951652691321765649797317978719005197091454474994023113316556896645962493695224042733508050711348929839333268975425076706190718571368114565832606037337885928582148352474750670120752040879724475690861404690501755223470675148558466585162549271212820769607274299304455313343106018882796786159139807494557321400648575572140308309262269361197814735557256648342299738920538361329361569876924074413836967285770241/19767429784718866858428085056283425785575398765734975231914495280262724097119223236553294311630565215390269665248942922978356332780412188755004235077262835815506659105445580231649936579080522908031488946828462887996197678521722654938999680797825342526121209669440715850601892780380379639408683936548011786316379398615750442050564981848672414014688547764279613609774414409259731125380750385761077840796163600017039055654208

2833435737297490372197833435326963031011684868637946461070150165351815684051896857032734093509190251236931974618010974047831439617560168336051239135360468509194806635383606057063242542377527694732400912783414569195121219399866379733874310913147798808870315117598525466321577071782488478996841467439022092578591426787030042647529170690189895236669405822307376193233209939124415047200783526043721600086580203772213866914414960602484904081658312252799769021742671703939462433931754193257193468238433273695405674024010013699111943438119813028314805072419123370003912794206239543211441787705192006023339949917389155547067875903545721835567229123227334210214625560816136228473866547695397510239813500352270340001556862596588359933623387011277862095031386301080279595017575377487859894553796941243877183594834494850134796497363395872530118686100493004066221158065896257554770345549879292461870319747970914438994556033263199665390148334995079164844163123017012067694759291552683061804267821821892984757143889007666024467493670548415688000103534837544499791471064867335475554872757877160675314174728313487701213697906708165794776813869983730394420655377711245227845467252381791972000646322543509016541673112529228404817217174969969794109809112545004118087290653919535225973781791241949910389603254394169591220155427807694344610954636252179332723801164610663706196099774821865222704303740590524079384980619233873583078823907109990272667152050948158368034219733933854644311145269802597079889889141250414294546964991702839252319017607008346004019848941380660128245767941322813678426281917128802784829943414552368492502338875078565454113121952788582626726738132273960519921035944352297884060612317224961/484711131535783727126354980997507925476027575994762383014966976404866420670014155822253835682226373456238586549131754244932006453032635755009108775719807358095851178888614833323768270947942578315357314827079372473711720859866961118451378105432785402830951070253101220097545141275339312394556922478756006475287342513075956327483140791798905493794206912556781361495169185809590765180555088119078926495436792684045723223058934482361827025929693146321708174983816930222111426115636749801104587708671628711513908125860998646056956479344394473748435247671218817669001453308990441393140954507303218699458515863131230504952787280024827512835941732214798364813175736590072530248670491725960482526330120087485913937743270932750135788105338289734435931972969680558157115681351723802675369077596063385920288724332205517811957033056844347755239374901162843181190037571540110146622737476648085806045421221349682385028770129792236253616376221612458230629154835049146977551380847174111153114997821439365086626639116886924326202557165019643592815381632797151202576204726439427770532132364608125920827495458310311956905247912252670137142323428111445688647644671104733771440378130690331261325971599081147870372117868040762031132905196084730182509396286055335239641664877478254987160092862844461337840615592126261048930903078955430063365235532540819323676404560100575034490954539804559554412463487712748741699416607821668867946804631531053499138781419644438556008417096271498372828235195092586675783276605693494360492677030480546070621305881032944421595735681584841250788977321232062332115750789757506185072358249632985199420525015217579673564177091342110545393225107737173694619284584456859375722332692945536

Top

Reply to: mathe () (one star (intermediate) Credit: 105 23:04:39 score: 0

?

Now let's prove that I have listed three types of equations:

The second and third solutions must be expressed in the first one:

For example, for the second solution:

(X0, y0, S) meet

25x0 ^ 4-y0 ^ 4 = s ^ 2, Response: A = (25x0 ^ 4 + y0 ^ 4)/(2x0y0s)

And (x0, y0) = 1, then 5x0 ^ 2-y0 ^ 2 is the same as 5x0 ^ 2 + y0 ^ 2, so they are the number of pixels. Suppose

5x0 ^ 2-y0 ^ 2 = W0 ^ 2

5x0 ^ 2 + y0 ^ 2 = z0 ^ 2

Then z0 ^ 4-w0 ^ 4 = 5 * (2x0y0) ^ 2

Therefore, u = z0, V = w0, W = 2x0y0 is a solution in the first case,

Corresponding solution: (z0 ^ 4 + w0 ^ 4)/(2z0w0x0y0) =

That is, the solution obtained through the second method can be expressed as the solution of the first method.

The solution obtained by the third method can also be expressed as the solution of the first method.

That is to say, as long as the first equation is sufficient.

On the contrary, any solution in the first case must be expressed in the second or third mode (and only one)

For example, solution 41/12 belongs to the second type. (U = 1, V = 2)

In addition, I now feel that there is only one unique solution for the second type. For the third type, all solutions can be provided through the above recursive method.

However, no proof is found yet.

Top

Reply to: mathe () (one star (intermediate) Credit: 105 9:23:26 score: 0

?

In the second case, the solution is not the only one:

For example, Equation

25u ^ 4-v ^ 4 = w ^ 2

There is also a set of reciprocal solutions: U = 2257, V = 1562, W = 25353117

You can get

A = 135699514816341/178761481355556

The constructor is as follows:

For the solution of the equation 5u ^ 2 = 4s ^ 4 + t ^ 4, take u = u, v = 2st

25u ^ 4-v ^ 4 = (4S ^ 4 + t ^ 4) ^ 2-16s ^ 4t ^ 4 = (4S ^ 4-T ^ 4) ^ 2, so we can use W = 4s ^ 4-T ^ 4.

For example, (u = 2257, V = 1562) is obtained through S = 11, t = 71.

(U = 1, V = 2) is obtained through S = 1, t = 1.

In addition, there are S = 1, t = 2 and S = 71, t = 22. The calculated a is the same as the above two.

Now we know that the solution in the second case is not the only one.

If we can calculate all the solutions in the second case and take these solutions as the initial values and take them into the third case for iteration, We can get all the solutions in the third case.

Top

Reply to: mathe () (one star (intermediate) Credit: 105 9:27:25 score: 0

?

The above a is incorrect. It is 642780541615689/178761481355556.

Top

Reply to: mathe () (one star (intermediate) Credit: 105 9:47:20 score: 0

?

Oh, the above is still wrong.

Now, through the solution of the second case, we can get a series of Case 3 solutions:

654686219104361/178761481355556

209239116668342644167838867143329714389679018137228536721441/93092380947563478644577555596900542802151091304399908363272

3794348487019039925749542059168247734797908973709179106909983896239377149515833243882286461568616348484744491510655657143661239022616957713454682013208875160676334692233507498261805795066141359230489600095452352932525466146406241929029761/243925260823291529729692315005448859561634050754936816805200100984783618700778962443357837295164825784916534061038440057954285176440604434211160839097473045564824135067123979950653214644895642133945988446008361351138718118630288888299024

207364430083289887306917248265176096518857981645462902868504798091754202260825583409895319188959462224847241752421626616161014877081435692849550193568633125665218149739525971640532334126691439163268851475907330790423611818390279300970707752287358942865876973376416469872280909079124665236320464139770291310201031642325408470721770267276253966505707135540099621647613354081934352911374127888639261077350989546158309363721959849792305514886953186022569732775857920051066563004090503605311935911100676458947187615329444701352956338573403802250756630773471486838493527994952130506437946300399125284844254413703199511309112933692340207491327621738540087619615083094972358297721192466233971637302656412523830838006230481887378890733258867510300963866643548479762304024122921630162372461667746643087564321981902980377028464770617242777938822749701936328198597103934224252113495873023654064678697677964175011710840299369622725954114597052926897871242374423041/26644383802526085744736421561294879699078713412473603781719070365535395480804939427471215230954946855798217099140387691275068944060152676069185175625835014006276422698858368042149591070592802546370017881232658654576464938019395755758723833216303735337625436919230945425551994053339428713070338053858734395865556171114199370053806875871908434203621185200134663913270135894619064154902731070694972954897378064428990436567474775231571765781337305138157197761032225105822159467642761014814353792431577288404876299838410751098610182295620157698893880893757984174256863783537769845204811841153546311055179606836840483382053981507812161318144115951830344446282026503222639918768351610920016013464315564009129936810512708692217363784821751276945062637083362385939467482936171236750565570393814191165165321790194941688892523213651298340456214328948603289527126670400768158455561820051575667870780119348107038276522331491132104127354654321229553096086284063712

Top

Reply to: mathe () (one star (intermediate) Credit: 105 19:45:55 score: 0

?

Here is a summary to illustrate how to solve this problem:

Step 1:

Search equations by Computer

5u ^ 2 = 4 * s ^ 4 + t ^ 4 (T is an odd number)

. Now I search for two groups of solutions (S = 1, t = 1 and S = 11, t = 71)

Step 2:

Take v = 2st, W = 4s ^ 4-T ^ 4, D = 25u ^ 4 + V ^ 4 for the (S, T, U) obtained in the first step of each group,

We can obtain a group of solutions A = D/(2uvw)

Step 3:

For each solution obtained in step 2 or step 3, A = D/(2uvw) = p/Q (converted to the approx mode, which can reduce the calculation workload ),

U = P, V = Q, u ^ 4-25v ^ 4 is the number of records, W = SQRT (U ^ 4-25v ^ 4), D = u ^ 4 + 25v ^ 4,

We can obtain a group of solutions A = D/(2uvw ).

In addition, if we can find all the solutions of the equation 5u ^ 2 = 4 * s ^ 4 + t ^ 4, we can find all possible a through this algorithm.

Top

Reply to: mathe () (one star (intermediate) Credit: 105 19:32:28 score: 0

?

Equation: 5u ^ 2 = 4 * s ^ 4 + t ^ 4

I got two more solutions.

T = 892225, S = 2493275

And

T = 11045611921

S = 5822032439

Through these solutions, we can get two other solutions in the second case (surely the denominator of the numerator is huge ).

You can obtain more 5u ^ 2 = 4 * s ^ 4 + t ^ 4 solutions in the following ways.

Search equation:

25a ^ 4 + 30a ^ 2 * B ^ 2 + B ^ 4 = w ^ 2

Let p1 = B/

P2 = (-2P1 + SQRT (25 + 30 * P1 ^ 2 + p1 ^ 4)/(1 + p1 ^ 2) = D/C

So P1 and P2 are rational numbers.

Let M = B * d, n = A * C

T = m ^ 2-25n ^ 2 + 10mn

S = m ^ 2-25n ^ 2

Is a solution.

Equation 25a ^ 4 + 30a ^ 2 * B ^ 2 + B ^ 4 = w ^ 2

I found three solutions:

A = 1, B = 6, c = 1, D = 1;

A = 6, B = 5, c = 61, D = 185;

A = 588, B = 1271, c = 37, D = 61;

Where a = 1, B = 6, c = 1, D = 1 corresponds to S = 11, t = 71.

Top

Reply to: mathe () (one star (intermediate) Credit: 105 22:06:37 score: 0

?

Haha, 25a ^ 4 + 30a ^ 2 * B ^ 2 + B ^ 4 = w ^ 2 in the next solution

B = 1562*5283 = 8252046

Next is

B = 3344161*113279 = 378823213919

Let's take two random numbers U2 and V2, And let m and n take 5u2 + V2 and 5u2-v2 respectively. (If a negative number is used to take the opposite number, we can take M and N as the difference, you can also use M to get the sum and N to get the difference). If 2 m ^ 2-N ^ 2 is the number of degrees (or the opposite number of degrees), then

B = Mn, A = 2 * m ^ 2-3mn + N ^ 2

Top

Reply to: mathe () (one star (intermediate) Credit: 105 9:31:04 score: 0

?

The solution of the equation 25a ^ 4 + 30a ^ 2 * B ^ 2 + B ^ 4 = w ^ 2 can also be calculated through recursion.

Set (A, B) as a group of solutions above, then:

Note S = 5A ^ 2-B ^ 2, T = 5A ^ 2 + B ^ 2

B '= ST

A' = SQRT (s ^ 4-3 * s ^ 2 * t ^ 2 + 2 * t ^ 4)/5)

Is a group of solutions, such as a = 1, B = 6, available, A' = 588, B '=-1271

The first several solutions of the equation are given below:

A = 1, B = 6

A = 588, B =-1271

A = 7066924182696, B = 378823213919

A = 1339292487821310144844876208030955730130705238172848, B = 62353608713680834676537482331752184610397022133175679

A = 653847017052681596985858386354972304592004671926407283004142638688138544810228375879362674859384259102583909848347601781674930175841262966955807108200483322024747022729914713948712732290509718978030014591911584, B =-15116249878927084323082375162074881670718984563501618492997336351956894910033543773404638070549516482211174394094412444035050568807695310556722764118509673769328904184606696785693209474773808545042791608377633281

A = 4642102823897693968460880211990481491126387340980503652403394793038199360975204789102998089937767391669497789716199275804782225247129170511061073666415512302917558851804345309213156589028523818499010516153110429962372759836269753415362990392343912287388310595878272971393481519848494416249430528956335963879011088620487075868391470709309530504555454394533473595643680508732063330558506185278015420706803630031879900826374428372969236088723501865519113349502887061629838682028723727496983670355565514459845529671847440509267954219855800161884600307837862521859132037659764592001328267359941993377942108539506027174786281275282368759939289085775132058996906116958661975415731806988624526139864471175664697141115466536614068698117406130915496629582710338362777986947371533584452248934365105221630774112465836888546887782034074363371470875489471808, B =-52208142508226584564173148081824184622796492490012921884102603428039998024667098090942066752817503946085834495109712498509322180691350504118697014043994522006040322430484406865169840472033747250005425611840359802659706692164411537879783652943136669530328945171621517833179116752493788903569544954617184781753660345476698103495495235837073175550434239219078247949237285297580430236298658725601259776113575227210593124620210692737806075248751026499229004496981617259782653170634944495728332537161881089178751267100111650123518456044586524835170101071553519531832651134630332923118289908189925873653359747207200457072345083593516713324599128689711857171370066198469952662623619945603909198350050446768272429011931324212842579192401311217845195311534508896184529021138162592392309767443140901198829889474726851089155904307179846768135109890442373121

Corresponding Perl program:

#! /Usr/bin/perl

Use bigint;

$ A = 1;

$ B = 6;

For ($ I = 0; $ I <6; $ I ++ ){

Print "A =". $ A. ", B =". $ B. "/N ";

$ S = 5 * $ A-$ B * $ B;

$ T = 5 * $ A + $ B * $ B;

$ B = $ S * $ t;

$ U = $ S * $ S-3 * $ S * $ T * $ t + 2 * $ T * $ t;

$ U = $ U/5;

$ A = SQRT ($ U );

$ S = $ A * $;

Print "error/N" unless ($ s EQ $ U );

}

Printf "A =". $ A. ", B =". $ B. "/N ";

Top

Reply to: mathe () (one star (intermediate) Credit: 105 8:39:06 score: 0

?

It is too complicated to write the following code in C language. It is mainly because C does not support Integers of any length.

(Generally, the integer in C language cannot exceed 2 ^ 64 ).

In fact, the above Perl program is very simple.

First line

#! /Usr/bin/perl

It is of little use. In Linux, the file is a Perl script.

Next line:

Use bigint;

It is equivalent to the header file in C, telling the computer to use an extra large integer with any precision. In this way, all the subsequent Variables

You can use Integers of any length.

In the program, I only use the for loop, and the C syntax is the same.

The only difference is that in Perl, all variable names must start with $ and do not need to be declared before variables are used.

Function print is used to output content to standard output (that is, stdout in C)

Print "error/N" unless ($ s EQ $ U );

It is actually in C if ($ s! = $ U ){

Printf ("error/N ");

}

EQ indicates equal.

Top

Reply to: diablostmontheearth (annihilus (99) (3502) (level 2 (Elementary) Credit: 100 15:36:33 score: 0

?

Mathe is a super high-handed. The CPP version corresponding to the mathe program uses cryptlib

# Include <cryptlib/integer. h>

# Include <iostream>

Using namespace STD;

Using namespace cryptopp;

/*

#! /Usr/bin/perl

Use bigint;

$ A = 1;

$ B = 6;

For ($ I = 0; $ I <6; $ I ++ ){

Print "A =". $ A. ", B =". $ B. "/N ";

$ S = 5 * $ A-$ B * $ B;

$ T = 5 * $ A + $ B * $ B;

$ B = $ S * $ t;

$ U = $ S * $ S-3 * $ S * $ T * $ t + 2 * $ T * $ t;

$ U = $ U/5;

$ A = SQRT ($ U );

$ S = $ A * $;

Print "error/N" unless ($ s EQ $ U );

}

Printf "A =". $ A. ", B =". $ B. "/N ";

*/

Int main ()

{

Integera = 1, B = 6, S, T, U;

For (INT I = 0; I <6; ++ I)

{

Cout <"A =" <A <", B =" <B <Endl;

S = 5 * a * A-B * B;

T = 5 * a * A + B * B;

B = S * t;

U = S * s-3 * S * T * t + 2 * T * t;

U/= 5;

A = U. squareroot ();

S = A *;

If (s! = U)

{

Cerr <"error" <Endl;

Break;

}

}

}