All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Self-Referential (Posted on 2010-07-29) Difficulty: 3 of 5
If you use the word "and" in naming numbers above 100, then, for example, 999 is named "nine hundred and ninety-nine". Considering this as four words, one of them hyphenated, the letter counts in the four words are 4, 7, 3 and 10. The product of these four numbers is 840.

There is one 3-digit number such that if you apply the above procedure, the final product of its four word lengths is the same as the original number. What is that number?

  Submitted by Charlie    
No Rating
Solution: (Hide)
The answer is 693 = 3*7*3*11

DEFDBL A-Z
DIM unit$(1 TO 9), teen$(10 TO 19), ten$(2 TO 9)

DATA one,two,three,four,five,six,seven,eight,nine
DATA ten,eleven,twelve,thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen
DATA twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety

FOR i = 1 TO 9: READ unit$(i): PRINT unit$(i); " "; : NEXT: PRINT
FOR i = 10 TO 19: READ teen$(i): PRINT teen$(i); " "; : NEXT: PRINT
FOR i = 2 TO 9: READ ten$(i): PRINT ten$(i); " "; : NEXT: PRINT

FOR n = 101 TO 999
  hundreds = n \ 100
  rest = n MOD 100
  IF rest > 0 THEN
    w1 = LEN(unit$(hundreds))
    w2 = LEN("hundred")
    w3 = LEN("and")
    IF rest < 10 THEN
      w4 = LEN(unit$(rest))
    ELSEIF rest < 20 THEN
      w4 = LEN(teen$(rest))
    ELSE
      tens = rest \ 10: units = rest MOD 10
      w4 = LEN(ten$(tens))
      IF units > 0 THEN w4 = w4 + LEN(unit$(units))
    END IF
    v = w1 * w2 * w3 * w4
  END IF
  IF n = v THEN PRINT n
NEXT


Based on Enigma No. 1590 "Return to starter" by Richard England, New Scientist, 10 April 2010, page 24.

Comments: ( You must be logged in to post comments.)
  Subject Author Date
re: spoilerbrianjn2010-07-31 04:52:08
Hyphenated words?brianjn2010-07-31 04:50:04
Solutiontrial end errorAdy TZIDON2010-07-29 19:17:51
SolutionanswerDej Mar2010-07-29 17:07:20
spoilerpcbouhid2010-07-29 15:39:11
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (11)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information