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

Home > General > Word Problems
Catch the catch phrase (Posted on 2024-08-20) Difficulty: 3 of 5
A famous English proverb was coded by me twice: the 1st line consists of 26 letters of the English ABC each being replaced by C for the consonants and by V for the vowels (word=CVCC) while the letters in the second line provide letter C for each of composite numbers in the list corresponding to the value of serial place of the letter and P if the number is prime. (word=>23,15,18,4=PCCC)

1st line:
CCVCCVCV CVCC CVC VVV CVCCVCV

2nd line:
CCACCPCC PCCC PPC CCC CCPCPCP

Rem1: Y is counted as a vowel
Rem2: A=1 is neither prime nor composite number so it stays A in the second line and V in the first

What is the original proverb?

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer Solution Comment 4 of 4 |
A computer search showed only a single possible word for the first and the last word of the phrase:  "Flattery ____ ___ ___ nowhere"
For words 2, 3, and 4, the number of possible words found in my wordlist was 222, 40, and 8.  One of the 8 choices for the 4th word was "you".  The other words of the proverb were present in the respective lists.

"Flattery will get you nowhere."

--------------
def vowelcode(word):
    ans = ''
    for char in word:
        if char in 'aeiouy':
            ans += 'V'
        else:
            ans += 'C'
    return ans

def primecode(word):
    ans = ''
    for char in word:
        num = ord(char) - 96
        if num == 1:
            ans += 'A'
            continue
        if isprime(num):
            ans += 'P'
        else:
            ans += 'C'
    return ans
    
wordss = [w for w in words if len(w) in [3,4,7,8]]

possibles = [[] for i in range(5)]

vs = ['CCVCCVCV', 'CVCC', 'CVC', 'VVV', 'CVCCVCV']
ps = ['CCACCPCC', 'PCCC', 'PPC', 'CCC', 'CCPCPCP']

for w in wordss:
    for loc in range(5):
        if vowelcode(w) == vs[loc] and primecode(w) == ps[loc]:
            possibles[loc].append(w)

  Posted by Larry on 2024-08-21 08:57:25
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 (5)
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