The inhabitants of BZland have been cutoff from the rest of the world for generations and their culture has drifted. For example, although they write out numerals in the Arabic manner, when counting verbally to nine, they use “biz” for 5, “buz” for 7 and “baz” for 9. Even more confusing, for numbers above 9, their system requires “biz” to be said once for every time the digit 5 appears in the number, and also an additional “biz” for each time 5 is a divisor of that number. Similar rules exist for numbers that contain and/or are divisible by 7 (“buz”) & 9 (“baz”). Numbers that do not result in any bizes, buzes or bazes merely retain their original name. Hence 10 is spoken “biz”, 27, “buz baz”, and 35 is “biz biz buz”. However, 31 is “thirtyone”. Also, due to their simplicity and isolation, the BZlanders have no need for numbers greater than 5000 ( “biz biz biz biz biz” ). To them, after that there is just “many”.
One consequence of this system is that verbal counting numbers are not always unique; hence math operations that can be done on paper are hard to interpret out loud. Can you answer the following? Analytical solutions preferred, if they exist. (Full disclosure: the author created the questions and found all answers by creating a list, but believes that some or all of the questions can be answered with analysis, logic and insight).
1) Once you reach the sixth “biz biz biz”, what is the largest number of consecutive numbers that are named by their conventional (English) names before you reach the seventh “biz biz biz”?
2) What is the smallest value that is correctly represented by “biz buz baz”?
3) Is there such a number as “biz biz buz buz baz baz”?
4) Is there such a number as “biz biz biz buz buz baz”?
5) Can you find a sequence of three numbers, n, n+1, n+2 where n=biz, n+1=buz & n+2=baz?
The list was produced by
OPEN "bizbuzba.txt" FOR OUTPUT AS #2
FOR i = 1 TO 5000
n$ = LTRIM$(STR$(i))
l$ = ""
ix = 0
DO
ix = INSTR(ix + 1, n$, "5")
IF ix > 0 THEN l$ = l$ + "i"
LOOP UNTIL ix = 0
num = i
DO
IF num MOD 5 = 0 THEN
l$ = l$ + "i"
num = num / 5
END IF
LOOP UNTIL num MOD 5 > 0
ix = 0
DO
ix = INSTR(ix + 1, n$, "7")
IF ix > 0 THEN l$ = l$ + "u"
LOOP UNTIL ix = 0
num = i
DO
IF num MOD 7 = 0 THEN
l$ = l$ + "u"
num = num / 7
END IF
LOOP UNTIL num MOD 7 > 0
ix = 0
DO
ix = INSTR(ix + 1, n$, "9")
IF ix > 0 THEN l$ = l$ + "a"
LOOP UNTIL ix = 0
num = i
DO
IF num MOD 9 = 0 THEN
l$ = l$ + "a"
num = num / 9
END IF
LOOP UNTIL num MOD 9 > 0
IF pp$ = "i" AND p$ = "u" AND l$ = "a" THEN PRINT i  2, i
IF l$ = "" THEN PRINT #2, i: ELSE PRINT #2, l$
pp$ = p$
p$ = l$
NEXT
where "i" represents "biz", etc.
1) Assuming that means the entire representation is "biz biz biz", the sixth such represents 255 and the seventh represents 325. Between those, the longest run of consecutive numbers that represent themselves is 4, and there are two of them: 281284 and 311314. Of course this is the longest possible sequence anywhere in the list as every 5th number is divisible by 5.
2) 252
3) No.
4) Yes. (2975 and 4725)
5) Yes. (n=2680 and n=3310)
Edited on January 18, 2007, 11:33 am

Posted by Charlie
on 20070118 11:28:06 