Question and Answers Forum

All Questions      Topic List

Number Theory Questions

Previous in All Question      Next in All Question      

Previous in Number Theory      Next in Number Theory      

Question Number 190285 by Abdullahrussell last updated on 31/Mar/23

Commented by ARUNG_Brandon_MBU last updated on 31/Mar/23

#include <stdio.h> int main(void) { unsigned int a, b; for (a = 100; a<1000; a++) { for (b = 300; b<1000; b++) { if (1001*a+1 == b*b) goto loopend; } } loopend: printf ("a = %u, b = %u", a, b); return 0; }

Commented by ARUNG_Brandon_MBU last updated on 31/Mar/23

Output: a = 183, b = 428

Commented by ARUNG_Brandon_MBU last updated on 31/Mar/23

Sorry! plaintext can only be written as comments not answers.

Commented by Rasheed.Sindhi last updated on 01/Apr/23

However you can write your solution as an 'Answer' in the following way: Empty answer +comment consisting plain text.

Commented by ARUNG_Brandon_MBU last updated on 01/Apr/23

���� ThAnKs

Answered by talminator2856792 last updated on 31/Mar/23

  b^2  − 1 = 1001a    (b − 1)(b + 1) = 1001a    (((b − 1)(b + 1))/(1001)) = a    (((b − 1)(b + 1))/(7 × 11 × 13 )) = a    each of 7, 11 and 13 must divide either b − 1 or b + 1      now the necessary combinations for multiplying 7, 11, 13 must be checked.      we have six cases:        one of the cases:    b + 1 is divisible by 7 × 11 and b − 1 divisible by 13      this could be expressed as    77x −2 ≡ 0 (mod 13)     ⇒ 77x ≡ 2 (mod 13) for some non negative x.    77 ≡ 12 (mod 13)    x = 11    b + 1 = 847      b = 846    a = 715        after applying this approach to all other cases      the following case yields the value for a that satisfies the conditions.         b + 1 is divisible by 11 × 13 and b − 1 divisible by 7      143x − 2 ≡ 0 (mod 7)    ⇒ 143x ≡ 2 (mod 7)    143 ≡ 3 (mod 7)    x = 3    b + 1 = 429    b = 428        a = 183

b21=1001a(b1)(b+1)=1001a(b1)(b+1)1001=a(b1)(b+1)7×11×13=aeachof7,11and13mustdivideeitherb1orb+1nowthenecessarycombinationsformultiplying7,11,13mustbechecked.wehavesixcases:oneofthecases:b+1isdivisibleby7×11andb1divisibleby13thiscouldbeexpressedas77x20(mod13)77x2(mod13)forsomenonnegativex.7712(mod13)x=11b+1=847b=846a=715afterapplyingthisapproachtoallothercasesthefollowingcaseyieldsthevalueforathatsatisfiestheconditions.b+1isdivisibleby11×13andb1divisibleby7143x20(mod7)143x2(mod7)1433(mod7)x=3b+1=429b=428a=183

Terms of Service

Privacy Policy

Contact: info@tinkutara.com