mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Puzzles (https://www.mersenneforum.org/forumdisplay.php?f=18)
-   -   When in Rome... (https://www.mersenneforum.org/showthread.php?t=14618)

CRGreathouse 2011-01-10 02:30

[QUOTE=science_man_88;245391]I've highlighted what in your list doesn't match in mine so can't be tested with similarities.[/QUOTE]

I'd generally expect that to be numbers with a 4 or a 9 in their decimal expansion, as well as numbers greater than 499 (or 488, for that matter).

CRGreathouse 2011-01-10 02:34

[QUOTE=science_man_88;245386]as for the medieval one could you not use variables like BV for a bar over v ?[/QUOTE]

Sure, or you could use _, or you could have it output HTML:
[code]<span style="text-decoration: overline">XV</span>MM[/code]
for 17,000. I'm not terribly pleased with any of these, so I just didn't implement it. You can do what you want.

If all you want is the number of characters, though, you can make a function that does that directly and get around the issue of output entirely.

science_man_88 2011-01-10 02:46

[QUOTE=CRGreathouse;245397]
If all you want is the number of characters, though, you can make a function that does that directly and get around the issue of output entirely.[/QUOTE]

I actually used a vector v and i eventually did get it returning, then I made my list by using:

[CODE]romanold();for(x=1,3999,if(length(Str(x))==v[x],print1(x",")))[/CODE]

romanold only does up to 3999 right now, I may change it. but it's something like my list that the OP was talking of I believe. next step for me would be checking for primes in this list. to match up with 2011. I haven't got a medieval function working like you have, and I'm still not sure what the other form you found is up to, worse I'm the one likely to make something like it so I'd kinda like to know how it worked.

davar55 2011-01-10 03:32

[quote]I actually used a vector v and i eventually did get it returning, then I made my list by using:

[CODE]romanold();for(x=1,3999,if(length(Str(x))==v[x],print1(x",")))[/CODE]romanold only does up to 3999 right now, I may change it. but it's something like my list that the OP was talking of I believe. next step for me would be checking for primes in this list. to match up with 2011. I haven't got a medieval function working like you have, and I'm still not sure what the other form you found is up to, worse I'm the one likely to make something like it so I'd kinda like to know how it worked.[/quote]It's a trivial point, but that extra comma at the end could be avoided.
Similar problem to the undesirably pluralized output I've often seen:
"1 objects".

NBtarheel_33 2011-01-10 09:46

Real mathematicians do it with pencil and paper!
 
Here's the "proofy" argument for what years work (using the commonly known, "Medieval" rules).

We have the symbols I, V, X, L, C, D, M. Let us consider years of 4 or less Arabic digits.

For the one-digit years: this is pretty easy. I = 1 and V = 5 are the only possibilities.

For the two-digit years: The first digit must be at least X but less than C, so the first digit will be either X or L. If it is X, then the second digit could be I, V, X, L, or C (which would make XI = 11, XV = 15, XX = 20, XL = 40, and XC = 90, respectively). If the first digit is L, on the other hand, then the second digit could be I, V, or X (which would make LI = 51, LV = 55, and LX = 60, respectively).

For the three-digit years: The first digit must be at least C but less than M, so the first digit will be either C or D.

Suppose the first digit is C. If the second digit is I, then the third digit can be I, V, or X (CII = 102, CIV = 104, CIX = 109). If the second digit is V, then the third digit can be I only (CVI = 106). If the second digit is X, then the third digit can be I, V, X, L, or C (CXI = 111, CXV = 115, CXX = 120, CXL = 140, CXC = 190). If the second digit is L, then the third digit can be I, V, or X (CLI = 151, CLV = 155, CLX = 160). If the second digit is C, then the third digit can be I, V, X, L, or C (CCI = 201, CCV = 205, CCX = 210, CCL = 250, CCC = 300). If the second digit is D, then the third digit can be I, V, X, or L (CDI = 401, CDV = 405, CDX = 410, CDL = 450). And finally, if the second digit is M, then the third digit can be I, V, X, or L (CMI = 901, CMV = 905, CMX = 910, CML = 950).

On the other hand, if the first digit is D - the same reasoning works for the second digit being I (DII = 502, DIV = 504, DIX = 509), the second digit being V (DVI = 506), the second digit being X (DXI = 511, DXV = 515, DXX = 520, DXL = 540, DXC = 590), the second digit being L (DLI = 551, DLV = 555, DLX = 560), and the second digit being C (DCI = 601, DCV = 605, DCX = 610, DCL = 650, DCC = 700). Note that the second digit *cannot* be D, nor can it be M. Hence we've enumerated all the three-digit possibilities.

Finally, consider the four-digit years. They must begin with M. Suppose the second digit is I. Then the third digit must be I (if not, then there are no legal ways in which to choose the fourth digit!), which forces the fourth digit to also be I. This yields MIII = 1003.

Suppose the second digit is V. Then the third digit again must be I, which forces the fourth digit to also be I. This yields MVII = 1007.

Suppose the second digit is X. Then the third digit may be I, V, X, L, or C. If the third digit is I, then the fourth digit must be I, V, or X (MXII = 1012, MXIV = 1014, MXIX = 1019). If the third digit is V, then the fourth digit must be I (MXVI = 1016). If the third digit is X, then the fourth digit can be I, V, or X (MXXI = 1021, MXXV = 1025, MXXX = 1030). If the third digit is L, then the fourth digit can be I or V (MXLI = 1041, MXLV = 1045). And if the third digit is C, then the fourth digit can be I or V (MXCI = 1091, MXCV = 1095).

Suppose the second digit is L. Then the third digit may be I, V, or X. If the third digit is I, then the fourth digit may be I, V, or X (MLII = 1052, MLIV = 1054, MLIX = 1059). If the third digit is V, then the fourth digit must be I (MLVI = 1056). And if the third digit is X, then the fourth digit may be I, V, or X (MLXI = 1061, MLXV = 1065, MLXX = 1070).

Suppose the second digit is C. Then the third digit may be I, V, X, L, C, D, or M. If the third digit is I, then the fourth digit may be I, V, or X (MCII = 1102, MCIV = 1104, MCIX = 1109). If the third digit is V, then the fourth digit must be I (MCVI = 1106). If the third digit is X, then the fourth digit may be I, V, X, L, or C (MCXI = 1111, MCXV = 1115, MCXX = 1120, MCXL = 1140, MCXC = 1190). If the third digit is L, then the fourth digit may be I, V, or X (MCLI = 1151, MCLV = 1155, MCLX = 1160). If the third digit is C, then the fourth digit may be I, V, X, L, or C (MCCI = 1201, MCCV = 1205, MCCX = 1210, MCCL = 1250, MCCC = 1300). If the third digit is D, then the fourth digit may be I, V, X, or L (MCDI = 1401, MCDV = 1405, MCDX = 1410, MCDL = 1450). And finally, if the third digit is M, the fourth digit may be I, V, X, or L (MCMI = 1901, MCMV = 1905, MCMX = 1910, MCML = 1950).

Suppose the second digit is D. Then the third digit may be I, V, X, L, or C, forcing the same choices for the fourth digit as in the previous case, and admitting the possible years MDII = 1502, MDIV = 1504, MDIX = 1509, MDVI = 1506, MDXI = 1511, MDXV = 1515, MDXX = 1520, MDXL = 1540, MDXC = 1590, MDLI = 1551, MDLV = 1555, MDLX = 1560, MDCI = 1601, MDCV = 1605, MDCX = 1610, MDCL = 1650, MDCC = 1700.

Lastly, suppose that the second digit is M. Then the third digit may be I, V, X, L, C, D, or M. It is left as an exercise for the reader to show that we have as possible candidates MMII = 2002, MMIV = 2004, MMIX = 2009, MMVI = 2006, MMXI = 2011, MMXV = 2015, MMXX = 2020, MMXL = 2040, MMXC = 2090, MMLI = 2051, MMLV = 2055, MMLX = 2060, MMCI = 2101, MMCV = 2105, MMCX = 2110, MMCL = 2150, MMCC = 2200, MMCD = 2400, MMCM = 2900, MMDI = 2501, MMDV = 2505, MMDX = 2510, MMDL = 2550, MMDC = 2600, MMMI = 3001, MMMV = 3005, MMMX = 3010, MMML = 3050, MMMC = 3100, MMMD = 3500, MMMM = 4000.

There are hence 145 years (only 26 remaining after 2011!) between AD 1 and AD 4000 inclusive where the number of Arabic digits and the number of Roman numerals needed to express the year number are equal. These years are:

1
5
11
15
20
40
51
55
60
90
102
104
106
109
111
115
120
140
151
155
160
190
201
205
210
250
300
401
405
410
450
502
504
506
509
511
515
520
540
551
555
560
590
601
605
610
650
700
901
905
910
950
1003
1007
1012
1014
1016
1019
1021
1025
1030
1041
1045
1052
1054
1056
1059
1061
1065
1070
1091
1095
1102
1104
1106
1109
1111
1115
1120
1140
1151
1155
1160
1190
1201
1205
1210
1250
1300
1401
1405
1410
1450
1502
1504
1506
1509
1511
1515
1520
1540
1551
1555
1560
1590
1601
1605
1610
1650
1700
1901
1905
1910
1950
2002
2004
2006
2009
2011
2015
2020
2040
2051
2055
2060
2090
2101
2105
2110
2150
2200
2400
2501
2505
2510
2550
2600
2900
3001
3005
3010
3050
3100
3500
4000

science_man_88 2011-01-10 15:37

[CODE](11:32)>romanold();forprime(x=1,4999,if(length(Str(x))==v[x],print1(x",")))
5,11,151,601,1021,1061,1151,1201,1511,1601,2011,3001,[/CODE]

so we have one more prime year that has the same length in both and that's 3001 good luck lasting the next 990 years to see it begin.

davieddy 2011-01-18 22:09

When in Rome....
 
...ask cmd for directions.


David

cmd 2011-01-18 22:40

not lead "|3 ° |\/| b" ... please
 
[QUOTE=davieddy;247249]...ask cmd for directions.


David[/QUOTE]



[URL="http://www.google.it/search?hl=it&&sa=X&ei=ARQ2TYnJFMigOpCc3LYC&ved=0CBkQBSgA&q=roma+auditorium+della+musica+matematica&spell=1"]choose[/URL] underground parking

Metro Euclid - R ° M e . It

davar55 2011-01-20 20:04

[QUOTE=davar55;245408]It's a trivial point, but that extra comma at the end could be avoided.
Similar problem to the undesirably pluralized output I've often seen:
"1 objects".[/QUOTE]

Sorry about quoting myself.

I didn't mean "I objects" but "1 objects".


All times are UTC. The time now is 04:55.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.