Donate to Remove ads

Got a credit card? use our Credit Card & Finance Calculators

Thanks to johnstevens77,Bhoddhisatva,scotia,Anonymous,Cornytiv34, for Donating to support the site

Houses

cinelli
Lemon Slice
Posts: 550
Joined: November 9th, 2016, 11:33 am
Has thanked: 231 times
Been thanked: 160 times

Houses

#424020

Postby cinelli » July 1st, 2021, 3:46 pm

There is an even number of houses in my road, numbered consecutively from 1 upwards, with the odd numbers on one side and the even numbers on the other.

My neighbour's daughter was practising with her new calculator. She found the sum of the squares of all the house numbers on one side and subtracted it from the sum of the squares of all the house numbers on the other side of the road. The digits in her answer were all the same.

Noticing that two of the houses displayed "For Sale" signs she decided to carry out a second calculation omitting those two houses. This gave an answer 50% higher than the first.

Which two houses are for sale?

Cinelli

modellingman
Lemon Slice
Posts: 614
Joined: November 4th, 2016, 3:46 pm
Has thanked: 594 times
Been thanked: 364 times

Re: Houses

#424095

Postby modellingman » July 2nd, 2021, 12:39 am

Spoiler....
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.


The difference between the sums of squares is

(2*2 + 4*4 + 6*6 + ... + 2n*2n) - (1*1 + 3*3 + 5*5 + ... + (2n-1)*(2n-1))

where n is the number of pairs of houses.

Re-arrange and use the factorisation of the difference between two squares
ie a*a - b*b = (a+b)(a-b)
to get the difference, say D, as

D = (2*2 - 1*1) + (4*4 - 3*3) + (6*6 - 5*5) + ... + (2n*2n - (2n-1)*(2n-1))
= 3 + 7 + 11 + ... + (4n-1).1
= 3 + 7 + 11 + ... + (4n-1)

The usual trick of writing the right hand side in reverse order and adding it to itself, results in each pair of corresponding terms
summing to the same value and allows the sum to be simplified. Doing this results in:

2*D = n(4n+2)
or
D = n(2n+1)

The final digit of n can take values of 0,...,9 and the table below shows the corresponding values of the final digit of 2n+1 and D

n	2n+1	D
0 1 0
1 3 3
2 5 0
3 7 1
4 9 6
5 1 5
6 3 8
7 5 5
8 7 6
9 9 1


If the difference between the two sums of squares (D) has all digits the same then the above table shows that the digit involved must be 1, 3, 5, 6 or 8. We can discount 0, since this implies D is zero and this only occurs when there are no houses in the street (ie when n=0).

Consequently, when all digits are the same, the last two digits of D must be 11, 33, 55, 66 or 88.

Consider the case of 11. The table above shows there are sub-cases leading to a 1 in the final digit of D, occurring when the final digit of n is a 3 or a 9.

Taking the first of these sub-cases, when the final digit of n is 3. First note that when n=3, D = 3*7 =21, so the final digit of n being 3 is a necessary but not sufficient condition for all digits in D being the same. We can now look at the final two digits of n, there are 10 possibilities and these are 03, 13, 23, ..., 93.

The table below, shows the final two digits of 2n+1 and D for these 10 possibilities.

n	2n+1	D

03 07 21
13 27 51
23 47 81
33 67 11
43 87 41
53 07 71
63 27 01
73 47 31
83 67 61
93 87 91


33 as the final two digits of n is the only one of the 10 possibilities that is consistent with all digits of D being the same. Again we note that this is not a sufficient condition since when n=33, D = 33*67 = 2211. When the exercise is repeated again, this time looking at all possibilities for the last 3 digits of n, the results show that 333 is the only possibility that results in the final 3 digits of D being the same (with a value of 111) but again n=333 is not a solution since in this case D = 222111. Successively repeating this process to examine the 10 possibilities for the final 4, 5, ... digits of n, identifies that at each stage we add another 3 onto the final digits of n but no solution is found. In fact, if the last k digits of n are all 3's then the last k digits of D will all be 1's but when n is assigned with k digits of 3's, D has 2k digits comprising k 2's followed by k 1's.

So although a 3 in the final digit of n looks like a possibility for all digits of D being the same, this never actually occurs.

The second sub-case has a 9 in the final digit of n. Following a similar process, we can consider the 10 possibilities for the final 2 digits of n (09, 19, 29,...,99) and look to see if any possibility is consistent with the final two digits of D being 11. When the final two digits are considered just one possibility (29) results in the final two digits of D being 11.However, in=29 is not a solution since it results in a value of D = 29*59 = 1711. Continuing the process to the final 3, 4, 5 digits results in just one feasible addition at each stage but no solution. I stopped after getting to 18229 as the final 5 digits of n, since a street with over 18000 pairs of houses seemed unrealistically long.

I'm sure there is a proof to be found that a D comprising just 1's is infeasible, but it probably requires a change of approach from the one I have adopted.

Moving on to the case for 33 being the final two digits of D requires the final digit of n to be 1. The 10 possibilities for the final two digits of n (01, 11, 21,...,91) result in the final two digits of D being either 03 or 53, meaning that there are no solutions resulting in the difference between the two sums of squares (D) having only 3's.

The case for 88 is similar. The final digit of n must be 6 and the 10 possibilities for the final two digits of n result in the final two digits of D being either 28 or 78, meaning that there are no solutions resulting in the difference between the two sums of squares having all 8's.

This leaves only 5 and 6 as the possibilities for the digit describing D.

For the case of 5, there are two sub-cases: the final digit of n can be 5 or 7.

Taking the first sub-case, n=5 is a solution with D = 5*11 = 55. Expanding the number of digits in n to 2, then 3, then 4, then 5 resulted at each stage in just one of the 10 possibles yielding the same number of 5's in the final digits of D, but no further solutions were found. I stopped looking at n=45505.

With the second sub-case, I stopped looking for possibilities at n=81057 without finding a solution.

For the case of 6, there are again two sub-cases: the final digit of n can be 4 or 8. Using the same approach as outlined above, there was again a single feasible possibility at each stage of adding a digit but, in the first sub-case no solution had been found by n=65794. For the second sub-case, n=18 is a solution with D=666. However, no further solutions beyond this (up to 90018) were found.

So, the conclusion drawn from the above is that there are only two possible solutions: the first involves 10 houses with difference in the sums of squares being 18,whilst the second involves 36 houses with the difference in the sums of squares, D, being 666.

Which of the two solutions is correct? Looks to me like it has to be the 36 house solution on the grounds that for the first solution the revised difference is 1.5*D = 1.5*55 = 82.5 and a non-integer solution cannot be obtained simply by eliminating two houses numbers.

The solution for thirty six houses requires the revised value D' to be 333 greater than D. This increase can come from either selling 2 odd-numbered houses or selling and odd-numbered house and an even-numbered house with a lower number. It cannot come from selling 2 even-numbered houses since this will necessarily reduce the calculated difference. It is a bit of a slog to find the solution but there is no solution involving 2 odd-numbered houses. However, selling houses 14 and 23 reduces the calculated value by 14*14 =196 and increases it by 23*23 = 529, giving the required increase of 529-196 = 333.


cinelli
Lemon Slice
Posts: 550
Joined: November 9th, 2016, 11:33 am
Has thanked: 231 times
Been thanked: 160 times

Re: Houses

#424646

Postby cinelli » July 4th, 2021, 12:00 pm

Well solved modellingman. I like this puzzle because of its two-part nature. You may think you have cracked it once you have found how many houses there are but finding the numbers of the two for sale is an extra little wrinkle. I have a slightly different approach, and this is not to say it’s better that modellingman’s:

If there are 2*n houses, the difference D is

D = n*(2*n + 1)

Because of the 50% increase in part 2, D (and therefore n) must be even. This can be rewritten as a quadratic:

2*n^2 + n – D = 0 (1)

and because D and n must be positive integers, the discriminant 1 + 8*D must be a perfect square. We can try different values of D as follows.

Could D be 22...2? This would make 1 + 8*D end in 7. Not a perfect square.
Could D be 44...4? This would make 1 + 8*D end in 3. Not a perfect square.
Could D be 66...6? This would make 1 + 8*D end in 9. A possibility.
Could D be 88...8? This would make 1 + 8*D end in 05. Not a perfect square.

Trying D = 6, 66, 666, 6666, etc, only 666 gives an integer n in (1), namely n = 18. So there are 36 houses.

For part 2 we are looking for the squares of two house numbers whose sum or difference is 333. Clearly they can’t both be odd or even so we are looking for an even p and an odd q such that

q^2 – p^2 = 333

Spot that the LHS is a difference of squares and factorise the RHS to give

(q + p) * (q - p) = 3*3*37

There are limited possibilities here. q+p=111, q-p=3 gives an odd p, not allowed.
q+p=37, q-p=9 gives the only solution: p=14, q=23.


Cinelli

Myfyr
2 Lemon pips
Posts: 130
Joined: November 4th, 2016, 2:34 pm
Has thanked: 30 times
Been thanked: 28 times

Re: Houses

#426303

Postby Myfyr » July 9th, 2021, 11:31 pm

How do i read spoilers on an ipad? Thanks.

UncleEbenezer
The full Lemon
Posts: 10690
Joined: November 4th, 2016, 8:17 pm
Has thanked: 1459 times
Been thanked: 2965 times

Re: Houses

#426307

Postby UncleEbenezer » July 9th, 2021, 11:47 pm

Myfyr wrote:How do i read spoilers on an ipad? Thanks.
If you can't highlight it and don't want to adjust your own palette, hit the followup button. Then you see the spoiler in your composition window. You can of course hit the back button when you're done - no need to write anything!

Myfyr
2 Lemon pips
Posts: 130
Joined: November 4th, 2016, 2:34 pm
Has thanked: 30 times
Been thanked: 28 times

Re: Houses

#426368

Postby Myfyr » July 10th, 2021, 10:57 am

UncleEbenezer wrote:
Myfyr wrote:How do i read spoilers on an ipad? Thanks.
If you can't highlight it and don't want to adjust your own palette, hit the followup button. Then you see the spoiler in your composition window. You can of course hit the back button when you're done - no need to write anything!


Thanks

Not sure how to change pallette and highlighting doesnt help. However using the double quotes opens up a reply where I can read the spoiler.

Gengulphus
Lemon Quarter
Posts: 4255
Joined: November 4th, 2016, 1:17 am
Been thanked: 2628 times

Re: Houses

#426424

Postby Gengulphus » July 10th, 2021, 1:16 pm

Myfyr wrote:
UncleEbenezer wrote:
Myfyr wrote:How do i read spoilers on an ipad? Thanks.
If you can't highlight it and don't want to adjust your own palette, hit the followup button. Then you see the spoiler in your composition window. You can of course hit the back button when you're done - no need to write anything!

Thanks

Not sure how to change pallette and highlighting doesnt help. However using the double quotes opens up a reply where I can read the spoiler.

A tweak to improve that technique a bit: having opened up the reply, find and delete the "[color=#DFEFFF]" (or similar) and "[/color]" tags that precede and follow the spoiler, then press the 'Preview' button. You'll then see the post with all the formatting its author intended apart from the spoiler concealment - which can make it considerably more readable if e.g. it includes pre-formatted tables.

Of course, don't follow that up by pressing the 'Submit' button!

Gengulphus


Return to “Games, Puzzles and Riddles”

Who is online

Users browsing this forum: No registered users and 10 guests