[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] 4 Consecutive Letters (generalized)



[Note: I posted this yesterday, but owing to mailing glitch
(I sent from the wrong address), it didn't show up in the list,
so I'm reposting.  ---TGM]

Using a different approach, here's a generalized version that can
easily be modified to find any linearly increasing (or decreasing)
sequence of N characters.  Here it is in the "4 consecutive 
increasing letters" mode:

perl -ne'((join"",map{$b=$a;($a=ord)-$b-1&&"x"}split//)=~/000/)&&print'

To change the desired interletter distance, change the 1 to your
distance (e.g., 1 would find "abcd"; 2 would find "aceg").  To change
the desired number of letters in the sequence, add or remove zeroes
in the pattern (000 = 4-letter sequences, 00 = 3-letter, ...)

I just couldn't resist doing a little exploring in /usr/dict/words.

There are 7 words I found that have 4-letter increasing sequences
with an interletter distance of 3 ("3-distance" words), all sharing
the "ailo" sequence:

sailor
sailorly
sailors
tailor
tailored
tailoring
tailors

And there's a boatload of 6-distance words, courtesy of the
popular "ciou" sequence:

atrocious
atrociously
audacious
audaciously
audaciousness
auspicious
...

In my 45,402-word /usr/dict/words, I couldn't find any words with
*decreasing* sequences of 4 consecutive letters (e.g., "dcba").
However, I found some "-3-distance" words, owing to "roli":

Carolina
Carolinas
Caroline
Carolingian
Carolinian
Carolinians
coliform
frolic
frolics
neurological
neurologists
paroling
proliferate   *
proliferated  *
proliferates  *
proliferating *
proliferation *
prolific      *
prolix

And, if that doesn't just beat all, you'll notice that of those
words, six are *5-letter* -3-distance words (courtesy "rolif").

I couldn't find any six-letter sequences, increasing or decreasing.
Perhaps somebody with a more exhaustive set of words can find
one or two.

Cheers,
Tom

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe