superprismatic Posted June 8, 2010 Report Share Posted June 8, 2010 If we were to write the numbers from 1 to 2001 in Roman numeral notation (see http://www.novaroma.org/via_romana/numbers.html ) and sort this list alphabetically, what would be the number in the middle (1001st in the list)? You can use the converter on the web site to check the way you form numbers using Roman numerals. Quote Link to comment Share on other sites More sharing options...
0 Guest Posted June 8, 2010 Report Share Posted June 8, 2010 (edited) The sequence starts with the numbers from 100 to 499 and from 900 to 999 (500 total), then the ones from 500 to 899 (400), then 1,2,3,4 and 9, then the numbers from 50 to 89 (40) then 36 more for 1000,1001..., 1100, 1101... and so on, then 1350,1351... until the 1001st number, which I think is 1368. I kinda lost my patience with this and I don't even know if I did it right, so here it goes. Edited June 8, 2010 by archlordbr Quote Link to comment Share on other sites More sharing options...
0 Guest Posted June 9, 2010 Report Share Posted June 9, 2010 if archlordbr is correct then 1368 in roman numerals is MCCCLXVIII Quote Link to comment Share on other sites More sharing options...
0 Guest Posted June 9, 2010 Report Share Posted June 9, 2010 1391 Quote Link to comment Share on other sites More sharing options...
0 Guest Posted June 9, 2010 Report Share Posted June 9, 2010 1391 is MCCCXCI Quote Link to comment Share on other sites More sharing options...
0 Guest Posted June 9, 2010 Report Share Posted June 9, 2010 MCCCXCI Quote Link to comment Share on other sites More sharing options...
0 Guest Posted June 9, 2010 Report Share Posted June 9, 2010 Brute force method! MCCCXCI 1391 Using a bash shell created the following script to convert decimal to roman numeral (Do multiple parenthesis work in roman numerals beyond 5 million?): $>cat roman_numeral.sh #!/bin/bash number=$1 roman="" iteration=0; ones_base=( "I" "X" "C" ) fives_base=( "V" "L" "D" ) ones=( $ones_base ) fives=( $fives_base ) if [[ ! $number =~ '^[0-9]+$' ]] ; then echo "Only argument is a single decimal number" fi while [[ $number -gt 0 ]] ; do nextitr=$(( $iteration + 1 )) openp=$( for (( re=0; re < $(( $nextitr / 3 )); re++)) ; do echo -n '('; done ) closep=$( for (( re=0; re < $(( $nextitr / 3 )); re++)) ; do echo -n ')'; done ) fives[$nextitr]="${openp}${fives_base[$nextitr % 3]}${closep}" openp=$( for (( re=0; re < $(( ($nextitr - 1) / 3 )); re++)) ; do echo -n '('; done ) closep=$( for (( re=0; re < $(( ($nextitr - 1) / 3 )); re++)) ; do echo -n ')'; done ) ones[$nextitr]="${openp}${ones_base[$nextitr % 3]}${closep}" remainder=$(( $number % 10 )) case $remainder in 1) roman="${ones[$iteration]}${roman}" ;; 2) roman="${ones[$iteration]}${ones[$iteration]}${roman}" ;; 3) roman="${ones[$iteration]}${ones[$iteration]}${ones[$iteration]}${roman}" ;; 4) roman="${ones[$iteration]}${fives[$iteration]}${roman}" ;; 5) roman="${fives[$iteration]}${roman}" ;; 6) roman="${fives[$iteration]}${ones[$iteration]}${roman}" ;; 7) roman="${fives[$iteration]}${ones[$iteration]}${ones[$iteration]}${roman}" ;; 8) roman="${fives[$iteration]}${ones[$iteration]}${ones[$iteration]}${ones[$iteration]}${roman}" ;; 9) roman="${ones[$iteration]}${ones[$nextitr]}${roman}" ;; esac (( number /= 10 )) (( iteration++ )) if [[ $iteration -eq 2 ]] ; then ones_base[0]="M" fi done echo $roman The sorting: $>for (( re=1; re <= 2001; re++ )) ; do echo "`./roman_numeral.sh $re` $re"; done | sort | awk 'NR == 1001' MCCCXCI 1391 What method did everyone else use? Quote Link to comment Share on other sites More sharing options...
Question
superprismatic
If we were to write the numbers from 1 to 2001 in Roman numeral notation
(see http://www.novaroma.org/via_romana/numbers.html ) and sort this list
alphabetically, what would be the number in the middle (1001st in the list)?
You can use the converter on the web site to check the way you form numbers
using Roman numerals.
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.