16
1
Output the following result (which is a result of calculating 6 * 9 in bases from 2 to 36). Make sure letters are uppercase, and the multiplication itself is outputed on every line.
6 * 9 = 110110
6 * 9 = 2000
6 * 9 = 312
6 * 9 = 204
6 * 9 = 130
6 * 9 = 105
6 * 9 = 66
6 * 9 = 60
6 * 9 = 54
6 * 9 = 4A
6 * 9 = 46
6 * 9 = 42
6 * 9 = 3C
6 * 9 = 39
6 * 9 = 36
6 * 9 = 33
6 * 9 = 30
6 * 9 = 2G
6 * 9 = 2E
6 * 9 = 2C
6 * 9 = 2A
6 * 9 = 28
6 * 9 = 26
6 * 9 = 24
6 * 9 = 22
6 * 9 = 20
6 * 9 = 1Q
6 * 9 = 1P
6 * 9 = 1O
6 * 9 = 1N
6 * 9 = 1M
6 * 9 = 1L
6 * 9 = 1K
6 * 9 = 1J
6 * 9 = 1I
Shortest code wins.
It's the result from bases 2 to 36, not 10 to 36. – Howard – 2014-01-05T10:04:45.020
1@Howard: Fixed. I was considering changing 2 to 10, but forgot about this edit while fixing something else in the result, so I accidentally left it the wrong way. – Konrad Borowski – 2014-01-05T10:06:24.613
The challenge would be more interesting if you weren't allowed to use to use library functions for base conversion. – nitro2k01 – 2014-01-05T11:07:22.797
2
Calculate 6*9 in different bases
I wonder why the statement is worded thus, why6*9
and not simply54
? Perhaps the originally intended meaning was that6
and9
should be interpreted not always as decimal but in different bases? That would make the statement more logical, and the problem more interesting (but then we should start from base 10 to 36) – leonbloy – 2014-01-05T16:16:37.1772@leonbloy:
6
and9
are single-digit numbers. They mean the same in every base in which those digits are valid. – Ilmari Karonen – 2014-01-05T16:46:43.9931@IlmariKaronen: Correct, but
6 * 9 = 110110
doesn't make a lot of sense... – Dennis – 2014-01-05T18:09:46.7173
This is a reference to the Hitchhiker's Guide to the Galaxy series by Douglas Adams. In the series, the Answer to the Ultimate Question of Life, The Universe, and Everything is "42". Later, its revealed that the Ultimate Question of Life, the Universe, and Everything is "What do you get when you multiply six by nine?", which works out in base-13. Note: Douglas Adams said this was unintentional; "I don't write jokes in base-13".
– dr jimbob – 2014-01-10T21:14:21.4371
@leonbloy - "I wonder why the statement is worded thus," it's worded that way because of Hitchhiker's Guide to the Galaxy series. See http://en.wikipedia.org/wiki/Phrases_from_The_Hitchhiker%27s_Guide_to_the_Galaxy#Answer_to_the_Ultimate_Question_of_Life.2C_the_Universe.2C_and_Everything_.2842.29
– dr jimbob – 2014-01-10T21:17:49.780