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

 Two times n equals 2n-1 (Posted on 2012-09-25)
This is an extension of Two times three equals five.

Form words length of 2n-1 (n ≥ 3) such that, each (2n-1) letter word is the result of two n-letter words, the final letter of the first being the initial one of the second word. (It may be observed that, rip & pen → ripen is a valid example when n = 3.)

What is the largest value of n for which this is possible?

*** Proper nouns, acronyms, abbreviations, hyphens or spaces are not allowed.

 No Solution Yet Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution Comment 2 of 2 |

My word list is a bit different from Dej Mar's. I found the highest n to be 9 using a different word from either of his.

DECLARE FUNCTION isWord! (w\$)
CLS
OPEN "\words\words.txt" FOR INPUT AS #1
OPEN "2xnq2n-1.txt" FOR OUTPUT AS #3
DO
LINE INPUT #1, w1\$
IF w1\$ = LCASE\$(w1\$) AND LEN(w1\$) MOD 2 = 1 THEN
l2 = INT(LEN(w1\$) / 2 + 1)
IF isWord(LEFT\$(w1\$, l2)) AND isWord(RIGHT\$(w1\$, l2)) THEN
l = LEN(w1\$)
IF l > 11 THEN
PRINT USING "## & & &"; l; w1\$; LEFT\$(w1\$, l2); RIGHT\$(w1\$, l2)
PRINT #3, USING "## & & &"; l; w1\$; LEFT\$(w1\$, l2); RIGHT\$(w1\$, l2)
END IF
END IF
END IF
LOOP UNTIL EOF(1)
CLOSE

FUNCTION isWord (w\$)
n = LEN(w\$)
w1\$ = SPACE\$(n)
OPEN "\words\words" + LTRIM\$(STR\$(n)) + ".txt" FOR BINARY AS #2
l = LOF(2) / n
low = 1: high = l
DO
mid = INT((low + high) / 2)
GET #2, (mid - 1) * n + 1, w1\$
IF w1\$ = w\$ THEN isWord = 1: CLOSE 2: EXIT FUNCTION
IF w1\$ < w\$ THEN low = mid + 1:  ELSE high = mid - 1
LOOP UNTIL low > high
isWord = 0
CLOSE 2
END FUNCTION

produces a file which, when sorted, contains:

`2n-1 words17   architectonically architect tonically15   countershadings counters shadings15   counterstaining counters staining15   counterstepping counters stepping15   counterstrategy counters strategy15   dessertspoonful desserts spoonful15   electronegative electron negative15   electrosurgical electros surgical15   featherstitched feathers stitched15   featherstitches feathers stitches15   snippersnappers snippers snappers15   thunderstricken thunders stricken15   thunderstriking thunders striking15   troubleshooters troubles shooters15   troubleshooting troubles shooting15   whippersnappers whippers snappers13   bittersweetly bitters sweetly13   breaststroker breasts stroker13   breaststrokes breasts strokes13   candlesnuffer candles snuffer13   chlorinations chlorin nations13   chromospheres chromos spheres13   chromospheric chromos spheric13   coagulability coagula ability13   condemnations condemn nations13   conductresses conduct tresses13   consignations consign nations13   consumeristic consume eristic13   doublespeaker doubles speaker13   electrologies electro ologies13   electrologist electro ologist13   enchantresses enchant tresses13   fellowshipped fellows shipped13   fluorinations fluorin nations13   germinability germina ability13   halogenations halogen nations13   happenstances happens stances13   impregnations impregn nations13   inheritresses inherit tresses13   letterspacing letters spacing13   mantelshelves mantels shelves13   mastersingers masters singers13   masterstrokes masters strokes13   mineralogical mineral logical13   monofilaments monofil laments13   ossifications ossific cations13   pacifications pacific cations13   preformatting preform matting13   pretermission preterm mission13   protectresses protect tresses13   pseudoscience pseudos science13   psychosomatic psychos somatic13   psychosurgeon psychos surgeon13   psychosurgery psychos surgery13   replicability replica ability13   scatterations scatter rations13   stigmasterols stigmas sterols13   stipendiaries stipend diaries13   thermosetting thermos setting13   thermospheres thermos spheres13   thermospheric thermos spheric13   thermostating thermos stating13   vivifications vivific cations13   volcanologies volcano ologies13   volcanologist volcano ologist13   wafflestomper waffles stomper`

showing a largest value of n as 9, as the longest word is 17 = 2n-1.

 Posted by Charlie on 2012-09-25 14:44:14

 Search: Search body:
Forums (0)