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-aided solution | Comment 1 of 4
clearvars
alphabet='abcdefghijklmnopqrstuvwxyz';
vowels='aeiouy';
cons=setdiff( alphabet ,vowels);
 
line1='CCVCCVCV CVCC CVC VVV CVCCVCV';
line2='CCACCPCC PCCC PPC CCC CCPCPCP';

wds=fileread('c:\words\words8.txt');
l=length(wds)/8;
for i=1:l
  w=wds(i*8-7:i*8);
  v=w([3,6,8]);
  c=w([1,2,4,5,7]);
  if isempty(setdiff(v,vowels))
    if isempty(setdiff(c,cons))
      if w(3)=='a'
        good=true;
        for j=1:8
          n=strfind(alphabet,w(j));
          if isprime(n)~=(line2(j)=='P')
            good=false;
          end
        end
      end
      if good 
        disp(w)
      end
    end
  end
end

finds only the word "flattery" to match the first word.

Inspection shows "Flattery will get you nowhere."



  Posted by Charlie on 2024-08-20 21:53:40
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 (4)
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