## Le Monde puzzle [#944] A completely dull Le Monde mathematical puzzle:

Find all integer pairs (a,b) less than 10⁶ such that a-b=2015 and ab is a perfect square.

If  I write the only condition as the function

```perfect=function(c){
return(c==trunc(sqrt(c))^2)}
```

and brute-force checked for all possible solutions

```for (A in 2015:1e6)
if (perfect(A*(A-2015))) print(A)
trunc(y/10)*11+(y-10*trunc(y/10))-(y==10*trunc(y/10))}
```

which produced

``` 2015
 2304
 2420
 2511
 3627
 4212
 7056
 7595
 16640
 33759
 41616
 79092
 204020
```

as the 13 possible answers. If one checks between 10⁶ and 5 10⁶, the only remaining solution is 1,016,064. Which is the highest possible one according to Le Monde.

### 3 Responses to “Le Monde puzzle [#944]”

1. Olav Says:

Proving analytically that a=1,016,064 is the largest possible value of a is a bit less dull. Here’s one way to do so:

We have b(b+2015)=c^2 for some c. Note that b (and hence a) is maximized if and only if c is maximized, so let’s try to maximize c. Note that any common divisor of b and b+2015 must also divide 2015. Let n be the largest such common divisor and put b=nd. Then n^2[d(d+2015/n)]=c^2, and we see that d(d+2015/n) must also be a square. But since d and d+2015/n do not share a common divisor, they must each be a square. Now, for a fixed n, maximizing c comes down to maximizing d(d+2015/n), which in turn reduces to maximizing d. But since d and d+2015/n are both square, d is maximized if and only if d and d+2015/n are *consecutive* squares. This means that d = e^2 and d+2015/n = e^2+2e+1, for some e, which in turn implies that e=2015/2n – 1/2. But this, in turn, implies that d = (2015/2n – 1/2)^2. Thus, for each n, we have that d and hence d(d+2015/n) is maximized when d=(2015/2n – 1/2)^2. This implies that, for each n, b is maximized when b = n*(2015/2n – 1/2)^2. Moreover, this implies that a is maximized when a = n*(2015/2n – 1/2)^2 + 2015. Now let’s maximize over n. Clearly, n*(2015/2n – 1/2)^2 + 2015 is maximized when n=1 (the only possibilities are n=1, 5, 13, 31, 65, 155, 403, or 2015, since n must be a divisor of 2015). Therefore, the maximum of a is 1*(2015/2 – 1/2)^2 + 2015 = 1,016,064.

• xi'an Says:

Thank you, this is indeed the only interesting point in the problem!

• xi'an Says:

A slightly faster argument is to derive from 2015=c²-b²=(c-b)(c+b) that c+b is a divider of 2015, i.e. 5, 13, 31, 65, 155, 403, or 2015. When c+b=2015, we do recover 1,016,064.

This site uses Akismet to reduce spam. Learn how your comment data is processed.
{"ft_lang_label":"__label__en","ft_lang_prob":0.84039587,"math_prob":0.99273574,"size":2475,"snap":"2023-14-2023-23","text_gpt3_token_len":899,"char_repetition_ratio":0.13071631,"word_repetition_ratio":0.02739726,"special_character_ratio":0.4278788,"punctuation_ratio":0.12861736,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9997758,"pos_list":[0,1,2,3,4,5,6,7,8],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-04T08:18:59Z\",\"WARC-Record-ID\":\"<urn:uuid:712f6858-287c-4af2-8b90-58a00a2eaedd>\",\"Content-Length\":\"67482\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7ce900ec-4466-4fed-969f-911b975d8b96>\",\"WARC-Concurrent-To\":\"<urn:uuid:cb21c535-f2c7-4847-ac73-a63c40a7c6d8>\",\"WARC-IP-Address\":\"192.0.78.13\",\"WARC-Target-URI\":\"https://xianblog.wordpress.com/2016/01/20/le-monde-puzzle-944/\",\"WARC-Payload-Digest\":\"sha1:P47PNRXQYTUCQ4IHYR5XHIPSNKZ2LHLN\",\"WARC-Block-Digest\":\"sha1:KU4HAVQROHXXD2C3CGGBDEXLV3CIRLS7\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224649518.12_warc_CC-MAIN-20230604061300-20230604091300-00095.warc.gz\"}"}