17 January 2022

Numbers in words and Cardano triplets

 Numbers not containing 'e' when spelt out in words

We are asked for all the numbers under 100 meeting the above condition.

Fortunately, I wrote a numbers-to-words function in Visual Basic about 20 years ago for the purpose of printing the words on cheques (or checks).  Even more fortunately, I was able to find it, and it took little time to translate it into Perl.

Thereafter the solution is trivial.

It's mildly interesting that there are 19 Eban numbers under 100, but the twentieth one is 2000.

Cardano triplets

We are asked to compute the first 5 Cardano triplets (a, b, c) specified by:

Exactly how you order them and thus determine which are the first 5 is not specified, but I took it to mean the first 5 if you order them by a + b + c.

I chose to do this by testing all possible triplets containing numbers up to 100, of which there are 1 million.  By iterating first over c, then b, then a I saved a little time by calculating sqrt(c) only 100 times, and b * sqrt(c) only 10 000 times, but in fact that made little difference: my little Raspberry Pi did it in under 5 seconds with or without my optimisation (maybe because Perl does it anyway).

If we write the definition of the triplets in the form t1 + t2 = 1 it is interesting to look at the pattern. In every case t1 is >1 and t2 is thus negative, for example:

triplet (32, 11, 85) yields 5.10977222864644 + -4.10977222864644 = 1

There are some sets of triplets where their the t1 of each and thus the t2 of each are the same, for example:

(47, 40, 20) :: 6.09016994374947 + -5.09016994374947 = 1
(47, 80, 5) ::   6.09016994374947 + -5.09016994374947 = 1
(47, 20, 80) :: 6.09016994374947 + -5.09016994374947 = 1
(47, 16, 125) :: 6.09016994374947 + -5.09016994374947 = 1

By inspection, it appears that there is only one t1, t2 pair for a given a: that is, any triplets where a is, for example, 47, will have the same t1 and t2.  That implies that they also share b * sqrt(c) and thus b**2 * c, and indeed from the 47 example:

b = 40, c= 20   so b**2 * c = 1600 * 20 = 32000
b = 80, c = 5    so b**2 *c   = 6400 * 5  = 32000
b = 20, c = 80  so b**2 *c   = 400 * 80  = 32000
b = 16, c = 125  so b**2 *c   = 256 * 125  = 32000

From that pattern we can deduce that the following are also Cardano triplets:
(47, 10, 320) and (47, 5, 1280)
(47, 8, 500), (47, 4, 2000), (47, 2, 8000) and (47, 1, 32000)

To get those I took the original set of 47s and successively divided b by 2 and multiplied c by 4 until b was indivisible by 2 (with an integral result), and similarly multiplied b by 2 and divided c by 4 until c was indivisible.

Can we then say that we have identified all the triplets where a = 47?  I postulate that this is the case. 

It must be the case that any factor of 32000 that is a square will generate at least one triplet.  The prime factors of 32000 are 2**8 * 5**3.  So the possible square factors of 32000, ie the possible b**2s, are:
1, 4, 16, 64, 256, 25, 100, 400, 1600, 6400

... and thus the possible values of b are:
1, 2, 4, 8, 16, 5, 10, 20, 40 and 80

... and all of these are in the original set (for which I only searched a, b, and c up to 100), or in the 6 others that I deduced.

But remember that I postulated that all triplets with a = 47 have the same t1 and t2. I can't prove that, although the evidence suggests that it is the case.

So could we do the same for, say a = 48?  At this point I can't see (a) how we could do that, or (b) prove whether in fact any triplets exist for a = 48, but I leave that - as one of my textbooks used to say - as an exercise for the reader.






No comments:

Post a Comment