Last Post, Special Pythagorean triplet

My senior project is going to an end. During the progress, I had lots of fun and learned a lot of new stuff. Really appreciate my mentor, my teachers, and my lovely computer. Let me bring you the final problem.

Here it is:

A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,

a2 + b2 = c2

For example, 32 + 42 = 9 + 16 = 25 = 52.

There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc.

Do you still remember how hard you do when you meet a problem like find one side of a triangle by given the lengths of the other two sides. Let computer do it for you.

Here is the code:

//

//  main.cpp

//  problem 9

//

//  Created by dev-bolin on 1/12/15.

//  Copyright (c) 2015 dev-bolin. All rights reserved.

//

#include <iostream>

#include <math.h>

int main (int argc, char * const argv[]) {

    int limit = 1000;                   // initial conditions

    int a = 0;

    int b = 1;

    int c = 999;

    int tmpC = 999;

    bool notFound = true;

    int answer = 0;

    while(notFound){                    //

        c = –tmpC;

        b = 1;

        while(b < c){

            a = limit – (c + b);

            if((pow(a, 2) + pow(b, 2)) == pow(c, 2)){       // find the answer that fits the Special pythagorean triplet

                notFound = false;

                answer = a * b * c;

                break;

            }

            c–;                        // if not found, try another value

            b++;

        }

    }

    std::printf(“%d”, answer);

    return 0;

}

I am done with my senior project now. Remember just keep calm and carry on!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Summation of primes

I just came back from the break, and I still want to do something about prime numbers, because it is so unique in the secrets of mathematics. Therefore I pick problem 10. Lets take a look.

The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.

Find the sum of all the primes below two million.

Although the problem is only written in two lines, do not think this is a easy problem, because if let you calculate it all by your brain, it will take all your life to do it. Thankful to the invention of computer that allows us to solve something that seems to be impossible at first.

Nothing hard!!!!!! Brute Force!!!!! Here is the code:

//

//  main.cpp

//  problem 10

//

//  Created by dev-bolin //  Copyright (c) 2015 dev-bolin. All rights reserved.

//

#include <iostream>

#include <cmath>

using namespace std;

long long is_prime(long long n)

{

                                //returns 0 if not prime, 1 if prime

if (n % 2 == 0)

return0;

for (long long i = 3; i <= (pow(n,0.5)); i += 2)

{

if (n % i == 0)

return0;

}

return1;

}

int main()

{

unsignedlonglong sum = 0;

    

for (int i = 3; i < 2000000; i += 2)   // the loop that will add up all the the prime under two million

{

if (is_prime(i))

{

sum += i;

}

}

    

cout << sum + 2;

    

return0;

}

The answer is 142913828922. Can anybody solve it without any tool? ^_^

10001st prime

Although I am in the winter break now, I still want to share with some little trick about coding. Today I will provide the method about how to sort out the prime number.

Let us see the problem first:

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.

What is the 10 001st prime number?

I thought about it for a long time, but I could not come up with a simple answer. Therefore, I borrowed the solution from Pejman Moghadam.

Here is the code:

//

//  main.cpp

//  problem 7

//

//  Created by dev-bolin

//  Copyright (c) 2015 dev-bolin. All rights reserved.

//

#include <iostream>

using namespace std;

int main()

{

    const int max = 10001;   // set the maxism condision

    int count = 0;

    int i, j;

    

    for (i = 2; ; i++) {      // the loop that sort for the prime number

        for (j = 2; j < i; j++)

            if (i % j == 0)

                break;

        if (i == j) {         // count each prime number until 10001st

            count++;

            if (count == max)

                break;

        }

    }

    cout << max << “the number is: “ << i;

}

This method is using the brute force to sort out the number, which means that it would take a little bit longer time for computer to solve.

Hope you all enjoy your Christmas Break!!!!!!!!!!!!!!!!!

Smallest Multiple

I feeling like really enjoying solving small problem, such as the problem 4 I did last post. Therefore, I decide to do anther similar problem to maintain this kind of happiness and peace of doing coding. For this time, I pick problem 5.

Here it is:

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.

What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

When I first looked at this problem, I misunderstood the problem. I thought that 2520 can be divided by all 1to 10 number. Therefore I got totally not right answer. And then I found out that I was wrong, it should be the number could be divided by each of the 1 to 20…….

//

//  main.cpp

//  problem5

//

//  Created by dev-bolin

//  Copyright (c) 2015 dev-bolin. All rights reserved.

//

#include <iostream>

using namespace ::std;

int main()

{

    int primes[] = {2,3,5,7,11,13,17,19,23};  //up to 22 numbers

    int n = 1;                                // set n as the answer to the problem

    int temp;

    int nums = 20;

    

    for(int i=0; primes[i] <= nums; i++)       // set the loop for system to run

    {

        temp = 1;

        while(temp < nums)

        {

            if(temp * primes[i] <= nums)

            {

                temp *= primes[i];

            }

            else {break;}

        }

        n *= temp;

    }

    cout << n;                                 // print out the answer

    cin >> n;                                   //pause

    return 0;

}

The answer is 232792560. Before I finished the problem, I knew that the answer must be a large number. It turns out that I was right.

Remember nothing is hard. Whenever you meet difficulties, just keep calm and carry on!!!!!!!!!!!!!!!!!

Largest Palindrome Product

I was shocked by the last problem. Therefore, it is time for me to turn to some easy problem. For this time, I pick problem 4. Let’s take a look first:

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.

Find the largest palindrome made from the product of two 3-digit numbers.

This problem seems to be so mathematical, which I like most from this project. Combing mathematic and computer science, I can do something even crazier than one of those could reach.

Nothing hard in this problem. The only thing that I need to care is to sort for the two products, and find the largest number.

Here is my code:

//

//  main.cpp

//  problem 4

//

//  Created by dev-bolin

//  Copyright (c) 2015 dev-bolin. All rights reserved.

//

#include <iostream>

#include <iostream>

#include <math.h>

using namespace std;

int palindrom(int num);

int main()

{

    auto n1 = 999u;        // set up two number that are the products of a palindromic number

    auto n2 = 999u;

    unsigned int n = 0u;

    

    unsigned int largest = 0;

    

    for (; n1>=100; n2–)  // set the limit for each number

    {

        if (n2 < 100)

        {

            n1–;

            n2 = 999;

            continue;

        }

        

        if (palindrom(n1*n2) == n1*n2)   // set the condition to sort for the result

        {

            cout << “n1 << “ << n1 << ” n2 “ << n2 << endl;

            cout << n1*n2;

            

            if (largest < n1*n2)

                largest = n1*n2;

        }

    }

    

    cout << “Largest” << largest << endl;  // find the largest one

    

    return 0;

}

int palindrom(int num)

{

    int new_num = 0;

    int digit = 0;

    

    while (num != 0)                // get the answer for the problem

    {

        digit = num % 10;

        new_num = new_num*10 + digit;

        num /= 10;

    }

    

    return new_num;

}

The answer is 906609, which is the product of 993 and 913.

First Failure

Hi everybody. For the problem 98, I did not get the correct answer, but I am sure that by publishing my code, you may be get a clue about how to solve that problem. Contact me if you have any idea or interesting thoughts.

Here is my code:

#include “stdafx.h”

#include <map>

#include <set>

#include <string>

#include <vector>

using namespace std;

extern const char *cdict[];//’‚∏ˆ «◊÷µ‰

int iwbits[32]={0}; //√ø∏ˆ◊÷ƒ∏∂‘”¶µƒbit ,’‚∏ˆ”√¿¥øÏÀŸ≈–∂œ¡Ω∏ˆµ•¥  «∑Ò∫¨”–≤ªÕ¨µƒ◊÷ƒ∏

int imaxword=1;//”ˆº˚µƒ◊Ó≥§µƒ ˝◊÷∏ˆ ˝

struct sanumber{ //±£¥Ê“ª∏ˆ◊÷∑˚¥ÆªØµƒ ˝◊÷ saves a number in string format

string snum;

__int64 inum;

};

struct sword //±£¥Ê“ª∏ˆµ•¥  saves a english word (must upper)

{

string sw;

int wordbit; //mask of letter,µ•¥ ¿Ô”√µΩ¡À∂‡…Ÿ◊÷ƒ∏ ’‚¿Ô±Íº«“ªœ¬

sword(const char *ccs){ //ππ‘Ï∫Ø ˝

sw=ccs;

wordbit=0;

for(int i=0;i<sw.size();++i) {

wordbit|=getbit(ccs[i]);

}

if (imaxword<sw.length()) imaxword=sw.length(); //save the longest word’s length

}

static int getbit(char c) {//∑µªÿ’‚∏ˆ◊÷ƒ∏∂‘”¶µƒ’’÷

return iwbits[c-‘A’];//must be an upper word,error or else.

}

__int64 get_dec(sword *a,sanumber *n,char *destbuf32) //º∆À„¡Ω∏ˆµ•¥  «∑Òœ‡πÿ

{

char nc[10]={0,0,0,0,0,0,0,0,0,0};//”…”≤ª‘ –Ì¡Ω∏ˆ◊÷ƒ∏Õ¨ ±∂‘”¶“ª∏ˆ ˝◊÷ ,”√µΩ’‚∏ˆ

memset(destbuf32,0,32);//«Âø’

if (wordbit!=a->wordbit) return -1;//two word must contain same words ¡Ω∏ˆµ•¥ ∞¸∫¨◊÷ƒ∏ºØ∫œ∂º≤ªÕ¨ ≤ª”√‘Ÿ±»Ωœ¡À

if (n->snum.size()!=sw.size()) return -2;//the number’s length isn’t matching µ•¥ ≥§∂»∫Õ ˝◊÷≥§∂»≤ªÕ¨ ±±»¡À

//œ¬√Ê’‚∏ˆæÕ «”√¿¥ºÏ≤‚ ¡Ω∏ˆ◊÷ƒ∏¥˙±Ì“ª∏ˆ ˝◊÷µƒ«Èøˆ «∑Ò∑¢…˙

for(int i=sw.size()-1;i>=0;–i) {

if (nc[n->snum[i]-48]==0) {

nc[n->snum[i]-48]=sw[i];

}else{

if (nc[n->snum[i]-48]!=sw[i]) return -4;//it’s not allowed 2 letter have same number meaning

}

}

for (unsigned int i=0;i<sw.size();++i)

{

for (int j=a->sw.size()-1;j>=0;–j) {//replace

if  (a->sw[j]!=sw[i]) continue;

//same letter…

if (destbuf32[j]!=0) {

if (destbuf32[j]!=n->snum[i]) return -3;//duplicate number

//e.g. œ¬√Ê’‚∏ˆ¿˝◊”¿Ô A≥ˆœ÷¡Ω¥Œ µ´≤ªƒ‹Õ¨ ±¥˙±Ì1∫Õ3 ,À˘“‘∑«∑®

// self= ABAC , number=1234 , *a=CABC

// then A=1 ? 3  ,the A’s value is duplicate

}

destbuf32[j]=n->snum[i];

}

}

return _atoi64(destbuf32);//∞—–¬◊È∫œ≥ˆ¿¥µƒ ˝◊÷∑µªÿ

}

};

struct numberlib // ˝◊÷≤÷ø‚ ,√ø∏ˆ≤÷ø‚¥Ê∑≈œ‡Õ¨Œª ˝µƒ ˝◊÷,¿˝»Á 25 64 81 ∑≈‘2∫≈≤÷ø‚ 256,512,∑≈‘3∫≈≤÷ø‚

{

set<sanumber *> mapnum;

numberlib() {}

~numberlib() {// Õ∑≈ƒ¥Ê∫√œ∞πfl

set<sanumber *>::iterator mi=mapnum.begin(),me=mapnum.end();

for(;mi!=me;++mi) {//free memory

delete (*mi);

}

}

};

vector<sword> vecWord;//words’ lib µ•¥ ≤÷ø‚

vector<numberlib> vecNumLib;//number’s lib  ˝◊÷≤÷ø‚1

set<__int64> setNums;//all number  ˝◊÷≤÷ø‚2

int _tmain(int argc, _TCHAR* argv[])

{

char tmpbuf[32];

for(int i=0,k=1;i<26;++i) {//very important! 26 letter’s bit mask

iwbits[i]=k;k<<=1;

}

#if 0

//for test  ≤‚ ‘”√ ˝æ›

vecWord.push_back(sword(“CARE”));

//vecWord.push_back(sword(“WHAT”));

vecWord.push_back(sword(“RACE”));

vecWord.push_back(sword(“CREATION”));

vecWord.push_back(sword(“REACTION”));

#else

//load the dictionary from the array ,at the end of the prog’

//¥”ƒ©Œ≤µƒ¥ µ‰¿Ô∂¡

for(int i=0;cdict[i]!=0;++i) {

vecWord.push_back(sword(cdict[i]));

}

#endif

vecNumLib.resize(imaxword+1);//∏˘æ›”ˆµΩµƒ◊Ó¥Û ˝◊÷ π¿À„–Ë“™º∏∏ˆ≤÷ø‚

//iµƒΩ· ¯ ˝◊÷±æ¿¥ø…“‘≈™≥…10000,µ´ «¥ µ‰¿Ô”–∏ˆ14∏ˆ◊÷ƒ∏≥§µƒπ∑ ∫¥ ,’‚÷±Ω”µº÷¬  ˝◊÷ø‚“™≥§∫√∂‡

//À˘“‘ƒ„ø…“‘∞—œ¬√ʵƒ10000 ∏ƒ≥…10000000 ,

for(__int64 i=4;i<10000;++i) {

__int64 i2=i*i;

_i64toa(i2,tmpbuf,10);

int len=strlen(tmpbuf);

if (len>imaxword) break;//±»»ÁÀµ◊÷µ‰¿Ô◊Ó≥§µƒµ•¥  « big,ƒ«√¥ƒ„‘ ˝◊÷≤÷ø‚¿Ô¥Ê∑≈∏ˆ1024æÕ√˜œ‘∂‡”‡¡À ,“ÚŒ™√ª”–4Œªµƒµ•¥ ∞°

sanumber *new_num=new sanumber();

new_num->snum=tmpbuf;

new_num->inum=i2;

vecNumLib[len].mapnum.insert( new_num); //Ω´ ˝◊÷∞¥’’≥§∂»∑÷¿‡ ’‚—˘≤È’“ ±ƒ‹…Ÿ’“º∏¥Œ

setNums.insert(i2);//¥Ê»Î ˝◊÷≤÷ø‚2 ,’‚∏ˆ≤÷ø‚2≤ª∞¥’’≥§∂»∑÷¿‡ ,÷ª∏ÊÀflƒ„’‚∏ˆ ˝◊÷”–/Œfi±ª ’ƒ…

}

//start to calculate

string longest_word1,longest_word2,longest_num;

__int64 biggestNum=1;

string decnum;

for(unsigned int i=0;i<vecWord.size();++i) {

for(unsigned int j=i+1;j<vecWord.size();++j) { //‘¥ µ‰¿Ô»Œ—°¡Ω∏ˆµ•¥ Ω¯––±»Ωœ ≥§∂»≤ªÕ¨≤ª”∞œÏ±»Ωœ ¿˝»ÁEAT~TEA~256ø…“‘ AFFAIR~FAIR~600625 “≤––

int N=vecWord[i].sw.size();

set<sanumber *>::iterator si=vecNumLib[N].mapnum.begin(),se=vecNumLib[N].mapnum.end();

for(;si!=se;++si) {

__int64 deci64=vecWord[i].get_dec(&vecWord[j],*si,tmpbuf);

if (deci64<0) continue;

decnum=tmpbuf;

if (decnum==(*si)->snum) continue;

if (setNums.find(deci64)!=setNums.end()) {

//found the decrypted number in the square set

printf(“–> %s , %s , %s\r\n”,vecWord[i].sw.c_str(),vecWord[j].sw.c_str() ,(*si)->snum.c_str());

if ((*si)->inum>biggestNum ){//º«¬º◊Ó¥Ûµƒ ˝◊÷

biggestNum=(*si)->inum;

longest_word1=vecWord[i].sw.c_str();

longest_word2=vecWord[j].sw.c_str();

longest_num=(*si)->inum;

}

}

}

}

}

printf(“biggest: %s %s %ld”,longest_word1.c_str(),longest_word2.c_str(),biggestNum);

printf(“\r\n.ok.\r\n”);

getchar();

return0;

}

const char *cdict[]={“A”,“ABILITY”,“ABLE”,“ABOUT”,“ABOVE”,“ABSENCE”,“ABSOLUTELY”,“ACADEMIC”,“ACCEPT”,“ACCESS”,“ACCIDENT”,“ACCOMPANY”,“ACCORDING”,“ACCOUNT”,“ACHIEVE”,“ACHIEVEMENT”,“ACID”,“ACQUIRE”,“ACROSS”,“ACT”,“ACTION”,“ACTIVE”,“ACTIVITY”,“ACTUAL”,“ACTUALLY”,“ADD”,“ADDITION”,“ADDITIONAL”,“ADDRESS”,“ADMINISTRATION”,“ADMIT”,“ADOPT”,“ADULT”,“ADVANCE”,“ADVANTAGE”,“ADVICE”,“ADVISE”,“AFFAIR”,“AFFECT”,“AFFORD”,“AFRAID”,“AFTER”,“AFTERNOON”,“AFTERWARDS”,“AGAIN”,“AGAINST”,“AGE”,“AGENCY”,“AGENT”,“AGO”,“AGREE”,“AGREEMENT”,“AHEAD”,“AID”,“AIM”,“AIR”,“AIRCRAFT”,“ALL”,“ALLOW”,“ALMOST”,“ALONE”,“ALONG”,“ALREADY”,“ALRIGHT”,“ALSO”,“ALTERNATIVE”,“ALTHOUGH”,“ALWAYS”,“AMONG”,“AMONGST”,“AMOUNT”,“AN”,“ANALYSIS”,“ANCIENT”,“AND”,“ANIMAL”,“ANNOUNCE”,“ANNUAL”,“ANOTHER”,“ANSWER”,“ANY”,“ANYBODY”,“ANYONE”,“ANYTHING”,“ANYWAY”,“APART”,“APPARENT”,“APPARENTLY”,“APPEAL”,“APPEAR”,“APPEARANCE”,“APPLICATION”,“APPLY”,“APPOINT”,“APPOINTMENT”,“APPROACH”,“APPROPRIATE”,“APPROVE”,“AREA”,“ARGUE”,“ARGUMENT”,“ARISE”,“ARM”,“ARMY”,“AROUND”,“ARRANGE”,“ARRANGEMENT”,“ARRIVE”,“ART”,“ARTICLE”,“ARTIST”,“AS”,“ASK”,“ASPECT”,“ASSEMBLY”,“ASSESS”,“ASSESSMENT”,“ASSET”,“ASSOCIATE”,“ASSOCIATION”,“ASSUME”,“ASSUMPTION”,“AT”,“ATMOSPHERE”,“ATTACH”,“ATTACK”,“ATTEMPT”,“ATTEND”,“ATTENTION”,“ATTITUDE”,“ATTRACT”,“ATTRACTIVE”,“AUDIENCE”,“AUTHOR”,“AUTHORITY”,“AVAILABLE”,“AVERAGE”,“AVOID”,“AWARD”,“AWARE”,“AWAY”,“AYE”,“BABY”,“BACK”,“BACKGROUND”,“BAD”,“BAG”,“BALANCE”,“BALL”,“BAND”,“BANK”,“BAR”,“BASE”,“BASIC”,“BASIS”,“BATTLE”,“BE”,“BEAR”,“BEAT”,“BEAUTIFUL”,“BECAUSE”,“BECOME”,“BED”,“BEDROOM”,“BEFORE”,“BEGIN”,“BEGINNING”,“BEHAVIOUR”,“BEHIND”,“BELIEF”,“BELIEVE”,“BELONG”,“BELOW”,“BENEATH”,“BENEFIT”,“BESIDE”,“BEST”,“BETTER”,“BETWEEN”,“BEYOND”,“BIG”,“BILL”,“BIND”,“BIRD”,“BIRTH”,“BIT”,“BLACK”,“BLOCK”,“BLOOD”,“BLOODY”,“BLOW”,“BLUE”,“BOARD”,“BOAT”,“BODY”,“BONE”,“BOOK”,“BORDER”,“BOTH”,“BOTTLE”,“BOTTOM”,“BOX”,“BOY”,“BRAIN”,“BRANCH”,“BREAK”,“BREATH”,“BRIDGE”,“BRIEF”,“BRIGHT”,“BRING”,“BROAD”,“BROTHER”,“BUDGET”,“BUILD”,“BUILDING”,“BURN”,“BUS”,“BUSINESS”,“BUSY”,“BUT”,“BUY”,“BY”,“CABINET”,“CALL”,“CAMPAIGN”,“CAN”,“CANDIDATE”,“CAPABLE”,“CAPACITY”,“CAPITAL”,“CAR”,“CARD”,“CARE”,“CAREER”,“CAREFUL”,“CAREFULLY”,“CARRY”,“CASE”,“CASH”,“CAT”,“CATCH”,“CATEGORY”,“CAUSE”,“CELL”,“CENTRAL”,“CENTRE”,“CENTURY”,“CERTAIN”,“CERTAINLY”,“CHAIN”,“CHAIR”,“CHAIRMAN”,“CHALLENGE”,“CHANCE”,“CHANGE”,“CHANNEL”,“CHAPTER”,“CHARACTER”,“CHARACTERISTIC”,“CHARGE”,“CHEAP”,“CHECK”,“CHEMICAL”,“CHIEF”,“CHILD”,“CHOICE”,“CHOOSE”,“CHURCH”,“CIRCLE”,“CIRCUMSTANCE”,“CITIZEN”,“CITY”,“CIVIL”,“CLAIM”,“CLASS”,“CLEAN”,“CLEAR”,“CLEARLY”,“CLIENT”,“CLIMB”,“CLOSE”,“CLOSELY”,“CLOTHES”,“CLUB”,“COAL”,“CODE”,“COFFEE”,“COLD”,“COLLEAGUE”,“COLLECT”,“COLLECTION”,“COLLEGE”,“COLOUR”,“COMBINATION”,“COMBINE”,“COME”,“COMMENT”,“COMMERCIAL”,“COMMISSION”,“COMMIT”,“COMMITMENT”,“COMMITTEE”,“COMMON”,“COMMUNICATION”,“COMMUNITY”,“COMPANY”,“COMPARE”,“COMPARISON”,“COMPETITION”,“COMPLETE”,“COMPLETELY”,“COMPLEX”,“COMPONENT”,“COMPUTER”,“CONCENTRATE”,“CONCENTRATION”,“CONCEPT”,“CONCERN”,“CONCERNED”,“CONCLUDE”,“CONCLUSION”,“CONDITION”,“CONDUCT”,“CONFERENCE”,“CONFIDENCE”,“CONFIRM”,“CONFLICT”,“CONGRESS”,“CONNECT”,“CONNECTION”,“CONSEQUENCE”,“CONSERVATIVE”,“CONSIDER”,“CONSIDERABLE”,“CONSIDERATION”,“CONSIST”,“CONSTANT”,“CONSTRUCTION”,“CONSUMER”,“CONTACT”,“CONTAIN”,“CONTENT”,“CONTEXT”,“CONTINUE”,“CONTRACT”,“CONTRAST”,“CONTRIBUTE”,“CONTRIBUTION”,“CONTROL”,“CONVENTION”,“CONVERSATION”,“COPY”,“CORNER”,“CORPORATE”,“CORRECT”,“COS”,“COST”,“COULD”,“COUNCIL”,“COUNT”,“COUNTRY”,“COUNTY”,“COUPLE”,“COURSE”,“COURT”,“COVER”,“CREATE”,“CREATION”,“CREDIT”,“CRIME”,“CRIMINAL”,“CRISIS”,“CRITERION”,“CRITICAL”,“CRITICISM”,“CROSS”,“CROWD”,“CRY”,“CULTURAL”,“CULTURE”,“CUP”,“CURRENT”,“CURRENTLY”,“CURRICULUM”,“CUSTOMER”,“CUT”,“DAMAGE”,“DANGER”,“DANGEROUS”,“DARK”,“DATA”,“DATE”,“DAUGHTER”,“DAY”,“DEAD”,“DEAL”,“DEATH”,“DEBATE”,“DEBT”,“DECADE”,“DECIDE”,“DECISION”,“DECLARE”,“DEEP”,“DEFENCE”,“DEFENDANT”,“DEFINE”,“DEFINITION”,“DEGREE”,“DELIVER”,“DEMAND”,“DEMOCRATIC”,“DEMONSTRATE”,“DENY”,“DEPARTMENT”,“DEPEND”,“DEPUTY”,“DERIVE”,“DESCRIBE”,“DESCRIPTION”,“DESIGN”,“DESIRE”,“DESK”,“DESPITE”,“DESTROY”,“DETAIL”,“DETAILED”,“DETERMINE”,“DEVELOP”,“DEVELOPMENT”,“DEVICE”,“DIE”,“DIFFERENCE”,“DIFFERENT”,“DIFFICULT”,“DIFFICULTY”,“DINNER”,“DIRECT”,“DIRECTION”,“DIRECTLY”,“DIRECTOR”,“DISAPPEAR”,“DISCIPLINE”,“DISCOVER”,“DISCUSS”,“DISCUSSION”,“DISEASE”,“DISPLAY”,“DISTANCE”,“DISTINCTION”,“DISTRIBUTION”,“DISTRICT”,“DIVIDE”,“DIVISION”,“DO”,“DOCTOR”,“DOCUMENT”,“DOG”,“DOMESTIC”,“DOOR”,“DOUBLE”,“DOUBT”,“DOWN”,“DRAW”,“DRAWING”,“DREAM”,“DRESS”,“DRINK”,“DRIVE”,“DRIVER”,“DROP”,“DRUG”,“DRY”,“DUE”,“DURING”,“DUTY”,“EACH”,“EAR”,“EARLY”,“EARN”,“EARTH”,“EASILY”,“EAST”,“EASY”,“EAT”,“ECONOMIC”,“ECONOMY”,“EDGE”,“EDITOR”,“EDUCATION”,“EDUCATIONAL”,“EFFECT”,“EFFECTIVE”,“EFFECTIVELY”,“EFFORT”,“EGG”,“EITHER”,“ELDERLY”,“ELECTION”,“ELEMENT”,“ELSE”,“ELSEWHERE”,“EMERGE”,“EMPHASIS”,“EMPLOY”,“EMPLOYEE”,“EMPLOYER”,“EMPLOYMENT”,“EMPTY”,“ENABLE”,“ENCOURAGE”,“END”,“ENEMY”,“ENERGY”,“ENGINE”,“ENGINEERING”,“ENJOY”,“ENOUGH”,“ENSURE”,“ENTER”,“ENTERPRISE”,“ENTIRE”,“ENTIRELY”,“ENTITLE”,“ENTRY”,“ENVIRONMENT”,“ENVIRONMENTAL”,“EQUAL”,“EQUALLY”,“EQUIPMENT”,“ERROR”,“ESCAPE”,“ESPECIALLY”,“ESSENTIAL”,“ESTABLISH”,“ESTABLISHMENT”,“ESTATE”,“ESTIMATE”,“EVEN”,“EVENING”,“EVENT”,“EVENTUALLY”,“EVER”,“EVERY”,“EVERYBODY”,“EVERYONE”,“EVERYTHING”,“EVIDENCE”,“EXACTLY”,“EXAMINATION”,“EXAMINE”,“EXAMPLE”,“EXCELLENT”,“EXCEPT”,“EXCHANGE”,“EXECUTIVE”,“EXERCISE”,“EXHIBITION”,“EXIST”,“EXISTENCE”,“EXISTING”,“EXPECT”,“EXPECTATION”,“EXPENDITURE”,“EXPENSE”,“EXPENSIVE”,“EXPERIENCE”,“EXPERIMENT”,“EXPERT”,“EXPLAIN”,“EXPLANATION”,“EXPLORE”,“EXPRESS”,“EXPRESSION”,“EXTEND”,“EXTENT”,“EXTERNAL”,“EXTRA”,“EXTREMELY”,“EYE”,“FACE”,“FACILITY”,“FACT”,“FACTOR”,“FACTORY”,“FAIL”,“FAILURE”,“FAIR”,“FAIRLY”,“FAITH”,“FALL”,“FAMILIAR”,“FAMILY”,“FAMOUS”,“FAR”,“FARM”,“FARMER”,“FASHION”,“FAST”,“FATHER”,“FAVOUR”,“FEAR”,“FEATURE”,“FEE”,“FEEL”,“FEELING”,“FEMALE”,“FEW”,“FIELD”,“FIGHT”,“FIGURE”,“FILE”,“FILL”,“FILM”,“FINAL”,“FINALLY”,“FINANCE”,“FINANCIAL”,“FIND”,“FINDING”,“FINE”,“FINGER”,“FINISH”,“FIRE”,“FIRM”,“FIRST”,“FISH”,“FIT”,“FIX”,“FLAT”,“FLIGHT”,“FLOOR”,“FLOW”,“FLOWER”,“FLY”,“FOCUS”,“FOLLOW”,“FOLLOWING”,“FOOD”,“FOOT”,“FOOTBALL”,“FOR”,“FORCE”,“FOREIGN”,“FOREST”,“FORGET”,“FORM”,“FORMAL”,“FORMER”,“FORWARD”,“FOUNDATION”,“FREE”,“FREEDOM”,“FREQUENTLY”,“FRESH”,“FRIEND”,“FROM”,“FRONT”,“FRUIT”,“FUEL”,“FULL”,“FULLY”,“FUNCTION”,“FUND”,“FUNNY”,“FURTHER”,“FUTURE”,“GAIN”,“GAME”,“GARDEN”,“GAS”,“GATE”,“GATHER”,“GENERAL”,“GENERALLY”,“GENERATE”,“GENERATION”,“GENTLEMAN”,“GET”,“GIRL”,“GIVE”,“GLASS”,“GO”,“GOAL”,“GOD”,“GOLD”,“GOOD”,“GOVERNMENT”,“GRANT”,“GREAT”,“GREEN”,“GREY”,“GROUND”,“GROUP”,“GROW”,“GROWING”,“GROWTH”,“GUEST”,“GUIDE”,“GUN”,“HAIR”,“HALF”,“HALL”,“HAND”,“HANDLE”,“HANG”,“HAPPEN”,“HAPPY”,“HARD”,“HARDLY”,“HATE”,“HAVE”,“HE”,“HEAD”,“HEALTH”,“HEAR”,“HEART”,“HEAT”,“HEAVY”,“HELL”,“HELP”,“HENCE”,“HER”,“HERE”,“HERSELF”,“HIDE”,“HIGH”,“HIGHLY”,“HILL”,“HIM”,“HIMSELF”,“HIS”,“HISTORICAL”,“HISTORY”,“HIT”,“HOLD”,“HOLE”,“HOLIDAY”,“HOME”,“HOPE”,“HORSE”,“HOSPITAL”,“HOT”,“HOTEL”,“HOUR”,“HOUSE”,“HOUSEHOLD”,“HOUSING”,“HOW”,“HOWEVER”,“HUGE”,“HUMAN”,“HURT”,“HUSBAND”,“I”,“IDEA”,“IDENTIFY”,“IF”,“IGNORE”,“ILLUSTRATE”,“IMAGE”,“IMAGINE”,“IMMEDIATE”,“IMMEDIATELY”,“IMPACT”,“IMPLICATION”,“IMPLY”,“IMPORTANCE”,“IMPORTANT”,“IMPOSE”,“IMPOSSIBLE”,“IMPRESSION”,“IMPROVE”,“IMPROVEMENT”,“IN”,“INCIDENT”,“INCLUDE”,“INCLUDING”,“INCOME”,“INCREASE”,“INCREASED”,“INCREASINGLY”,“INDEED”,“INDEPENDENT”,“INDEX”,“INDICATE”,“INDIVIDUAL”,“INDUSTRIAL”,“INDUSTRY”,“INFLUENCE”,“INFORM”,“INFORMATION”,“INITIAL”,“INITIATIVE”,“INJURY”,“INSIDE”,“INSIST”,“INSTANCE”,“INSTEAD”,“INSTITUTE”,“INSTITUTION”,“INSTRUCTION”,“INSTRUMENT”,“INSURANCE”,“INTEND”,“INTENTION”,“INTEREST”,“INTERESTED”,“INTERESTING”,“INTERNAL”,“INTERNATIONAL”,“INTERPRETATION”,“INTERVIEW”,“INTO”,“INTRODUCE”,“INTRODUCTION”,“INVESTIGATE”,“INVESTIGATION”,“INVESTMENT”,“INVITE”,“INVOLVE”,“IRON”,“IS”,“ISLAND”,“ISSUE”,“IT”,“ITEM”,“ITS”,“ITSELF”,“JOB”,“JOIN”,“JOINT”,“JOURNEY”,“JUDGE”,“JUMP”,“JUST”,“JUSTICE”,“KEEP”,“KEY”,“KID”,“KILL”,“KIND”,“KING”,“KITCHEN”,“KNEE”,“KNOW”,“KNOWLEDGE”,“LABOUR”,“LACK”,“LADY”,“LAND”,“LANGUAGE”,“LARGE”,“LARGELY”,“LAST”,“LATE”,“LATER”,“LATTER”,“LAUGH”,“LAUNCH”,“LAW”,“LAWYER”,“LAY”,“LEAD”,“LEADER”,“LEADERSHIP”,“LEADING”,“LEAF”,“LEAGUE”,“LEAN”,“LEARN”,“LEAST”,“LEAVE”,“LEFT”,“LEG”,“LEGAL”,“LEGISLATION”,“LENGTH”,“LESS”,“LET”,“LETTER”,“LEVEL”,“LIABILITY”,“LIBERAL”,“LIBRARY”,“LIE”,“LIFE”,“LIFT”,“LIGHT”,“LIKE”,“LIKELY”,“LIMIT”,“LIMITED”,“LINE”,“LINK”,“LIP”,“LIST”,“LISTEN”,“LITERATURE”,“LITTLE”,“LIVE”,“LIVING”,“LOAN”,“LOCAL”,“LOCATION”,“LONG”,“LOOK”,“LORD”,“LOSE”,“LOSS”,“LOT”,“LOVE”,“LOVELY”,“LOW”,“LUNCH”,“MACHINE”,“MAGAZINE”,“MAIN”,“MAINLY”,“MAINTAIN”,“MAJOR”,“MAJORITY”,“MAKE”,“MALE”,“MAN”,“MANAGE”,“MANAGEMENT”,“MANAGER”,“MANNER”,“MANY”,“MAP”,“MARK”,“MARKET”,“MARRIAGE”,“MARRIED”,“MARRY”,“MASS”,“MASTER”,“MATCH”,“MATERIAL”,“MATTER”,“MAY”,“MAYBE”,“ME”,“MEAL”,“MEAN”,“MEANING”,“MEANS”,“MEANWHILE”,“MEASURE”,“MECHANISM”,“MEDIA”,“MEDICAL”,“MEET”,“MEETING”,“MEMBER”,“MEMBERSHIP”,“MEMORY”,“MENTAL”,“MENTION”,“MERELY”,“MESSAGE”,“METAL”,“METHOD”,“MIDDLE”,“MIGHT”,“MILE”,“MILITARY”,“MILK”,“MIND”,“MINE”,“MINISTER”,“MINISTRY”,“MINUTE”,“MISS”,“MISTAKE”,“MODEL”,“MODERN”,“MODULE”,“MOMENT”,“MONEY”,“MONTH”,“MORE”,“MORNING”,“MOST”,“MOTHER”,“MOTION”,“MOTOR”,“MOUNTAIN”,“MOUTH”,“MOVE”,“MOVEMENT”,“MUCH”,“MURDER”,“MUSEUM”,“MUSIC”,“MUST”,“MY”,“MYSELF”,“NAME”,“NARROW”,“NATION”,“NATIONAL”,“NATURAL”,“NATURE”,“NEAR”,“NEARLY”,“NECESSARILY”,“NECESSARY”,“NECK”,“NEED”,“NEGOTIATION”,“NEIGHBOUR”,“NEITHER”,“NETWORK”,“NEVER”,“NEVERTHELESS”,“NEW”,“NEWS”,“NEWSPAPER”,“NEXT”,“NICE”,“NIGHT”,“NO”,“NOBODY”,“NOD”,“NOISE”,“NONE”,“NOR”,“NORMAL”,“NORMALLY”,“NORTH”,“NORTHERN”,“NOSE”,“NOT”,“NOTE”,“NOTHING”,“NOTICE”,“NOTION”,“NOW”,“NUCLEAR”,“NUMBER”,“NURSE”,“OBJECT”,“OBJECTIVE”,“OBSERVATION”,“OBSERVE”,“OBTAIN”,“OBVIOUS”,“OBVIOUSLY”,“OCCASION”,“OCCUR”,“ODD”,“OF”,“OFF”,“OFFENCE”,“OFFER”,“OFFICE”,“OFFICER”,“OFFICIAL”,“OFTEN”,“OIL”,“OKAY”,“OLD”,“ON”,“ONCE”,“ONE”,“ONLY”,“ONTO”,“OPEN”,“OPERATE”,“OPERATION”,“OPINION”,“OPPORTUNITY”,“OPPOSITION”,“OPTION”,“OR”,“ORDER”,“ORDINARY”,“ORGANISATION”,“ORGANISE”,“ORGANIZATION”,“ORIGIN”,“ORIGINAL”,“OTHER”,“OTHERWISE”,“OUGHT”,“OUR”,“OURSELVES”,“OUT”,“OUTCOME”,“OUTPUT”,“OUTSIDE”,“OVER”,“OVERALL”,“OWN”,“OWNER”,“PACKAGE”,“PAGE”,“PAIN”,“PAINT”,“PAINTING”,“PAIR”,“PANEL”,“PAPER”,“PARENT”,“PARK”,“PARLIAMENT”,“PART”,“PARTICULAR”,“PARTICULARLY”,“PARTLY”,“PARTNER”,“PARTY”,“PASS”,“PASSAGE”,“PAST”,“PATH”,“PATIENT”,“PATTERN”,“PAY”,“PAYMENT”,“PEACE”,“PENSION”,“PEOPLE”,“PER”,“PERCENT”,“PERFECT”,“PERFORM”,“PERFORMANCE”,“PERHAPS”,“PERIOD”,“PERMANENT”,“PERSON”,“PERSONAL”,“PERSUADE”,“PHASE”,“PHONE”,“PHOTOGRAPH”,“PHYSICAL”,“PICK”,“PICTURE”,“PIECE”,“PLACE”,“PLAN”,“PLANNING”,“PLANT”,“PLASTIC”,“PLATE”,“PLAY”,“PLAYER”,“PLEASE”,“PLEASURE”,“PLENTY”,“PLUS”,“POCKET”,“POINT”,“POLICE”,“POLICY”,“POLITICAL”,“POLITICS”,“POOL”,“POOR”,“POPULAR”,“POPULATION”,“POSITION”,“POSITIVE”,“POSSIBILITY”,“POSSIBLE”,“POSSIBLY”,“POST”,“POTENTIAL”,“POUND”,“POWER”,“POWERFUL”,“PRACTICAL”,“PRACTICE”,“PREFER”,“PREPARE”,“PRESENCE”,“PRESENT”,“PRESIDENT”,“PRESS”,“PRESSURE”,“PRETTY”,“PREVENT”,“PREVIOUS”,“PREVIOUSLY”,“PRICE”,“PRIMARY”,“PRIME”,“PRINCIPLE”,“PRIORITY”,“PRISON”,“PRISONER”,“PRIVATE”,“PROBABLY”,“PROBLEM”,“PROCEDURE”,“PROCESS”,“PRODUCE”,“PRODUCT”,“PRODUCTION”,“PROFESSIONAL”,“PROFIT”,“PROGRAM”,“PROGRAMME”,“PROGRESS”,“PROJECT”,“PROMISE”,“PROMOTE”,“PROPER”,“PROPERLY”,“PROPERTY”,“PROPORTION”,“PROPOSE”,“PROPOSAL”,“PROSPECT”,“PROTECT”,“PROTECTION”,“PROVE”,“PROVIDE”,“PROVIDED”,“PROVISION”,“PUB”,“PUBLIC”,“PUBLICATION”,“PUBLISH”,“PULL”,“PUPIL”,“PURPOSE”,“PUSH”,“PUT”,“QUALITY”,“QUARTER”,“QUESTION”,“QUICK”,“QUICKLY”,“QUIET”,“QUITE”,“RACE”,“RADIO”,“RAILWAY”,“RAIN”,“RAISE”,“RANGE”,“RAPIDLY”,“RARE”,“RATE”,“RATHER”,“REACH”,“REACTION”,“READ”,“READER”,“READING”,“READY”,“REAL”,“REALISE”,“REALITY”,“REALIZE”,“REALLY”,“REASON”,“REASONABLE”,“RECALL”,“RECEIVE”,“RECENT”,“RECENTLY”,“RECOGNISE”,“RECOGNITION”,“RECOGNIZE”,“RECOMMEND”,“RECORD”,“RECOVER”,“RED”,“REDUCE”,“REDUCTION”,“REFER”,“REFERENCE”,“REFLECT”,“REFORM”,“REFUSE”,“REGARD”,“REGION”,“REGIONAL”,“REGULAR”,“REGULATION”,“REJECT”,“RELATE”,“RELATION”,“RELATIONSHIP”,“RELATIVE”,“RELATIVELY”,“RELEASE”,“RELEVANT”,“RELIEF”,“RELIGION”,“RELIGIOUS”,“RELY”,“REMAIN”,“REMEMBER”,“REMIND”,“REMOVE”,“REPEAT”,“REPLACE”,“REPLY”,“REPORT”,“REPRESENT”,“REPRESENTATION”,“REPRESENTATIVE”,“REQUEST”,“REQUIRE”,“REQUIREMENT”,“RESEARCH”,“RESOURCE”,“RESPECT”,“RESPOND”,“RESPONSE”,“RESPONSIBILITY”,“RESPONSIBLE”,“REST”,“RESTAURANT”,“RESULT”,“RETAIN”,“RETURN”,“REVEAL”,“REVENUE”,“REVIEW”,“REVOLUTION”,“RICH”,“RIDE”,“RIGHT”,“RING”,“RISE”,“RISK”,“RIVER”,“ROAD”,“ROCK”,“ROLE”,“ROLL”,“ROOF”,“ROOM”,“ROUND”,“ROUTE”,“ROW”,“ROYAL”,“RULE”,“RUN”,“RURAL”,“SAFE”,“SAFETY”,“SALE”,“SAME”,“SAMPLE”,“SATISFY”,“SAVE”,“SAY”,“SCALE”,“SCENE”,“SCHEME”,“SCHOOL”,“SCIENCE”,“SCIENTIFIC”,“SCIENTIST”,“SCORE”,“SCREEN”,“SEA”,“SEARCH”,“SEASON”,“SEAT”,“SECOND”,“SECONDARY”,“SECRETARY”,“SECTION”,“SECTOR”,“SECURE”,“SECURITY”,“SEE”,“SEEK”,“SEEM”,“SELECT”,“SELECTION”,“SELL”,“SEND”,“SENIOR”,“SENSE”,“SENTENCE”,“SEPARATE”,“SEQUENCE”,“SERIES”,“SERIOUS”,“SERIOUSLY”,“SERVANT”,“SERVE”,“SERVICE”,“SESSION”,“SET”,“SETTLE”,“SETTLEMENT”,“SEVERAL”,“SEVERE”,“SEX”,“SEXUAL”,“SHAKE”,“SHALL”,“SHAPE”,“SHARE”,“SHE”,“SHEET”,“SHIP”,“SHOE”,“SHOOT”,“SHOP”,“SHORT”,“SHOT”,“SHOULD”,“SHOULDER”,“SHOUT”,“SHOW”,“SHUT”,“SIDE”,“SIGHT”,“SIGN”,“SIGNAL”,“SIGNIFICANCE”,“SIGNIFICANT”,“SILENCE”,“SIMILAR”,“SIMPLE”,“SIMPLY”,“SINCE”,“SING”,“SINGLE”,“SIR”,“SISTER”,“SIT”,“SITE”,“SITUATION”,“SIZE”,“SKILL”,“SKIN”,“SKY”,“SLEEP”,“SLIGHTLY”,“SLIP”,“SLOW”,“SLOWLY”,“SMALL”,“SMILE”,“SO”,“SOCIAL”,“SOCIETY”,“SOFT”,“SOFTWARE”,“SOIL”,“SOLDIER”,“SOLICITOR”,“SOLUTION”,“SOME”,“SOMEBODY”,“SOMEONE”,“SOMETHING”,“SOMETIMES”,“SOMEWHAT”,“SOMEWHERE”,“SON”,“SONG”,“SOON”,“SORRY”,“SORT”,“SOUND”,“SOURCE”,“SOUTH”,“SOUTHERN”,“SPACE”,“SPEAK”,“SPEAKER”,“SPECIAL”,“SPECIES”,“SPECIFIC”,“SPEECH”,“SPEED”,“SPEND”,“SPIRIT”,“SPORT”,“SPOT”,“SPREAD”,“SPRING”,“STAFF”,“STAGE”,“STAND”,“STANDARD”,“STAR”,“START”,“STATE”,“STATEMENT”,“STATION”,“STATUS”,“STAY”,“STEAL”,“STEP”,“STICK”,“STILL”,“STOCK”,“STONE”,“STOP”,“STORE”,“STORY”,“STRAIGHT”,“STRANGE”,“STRATEGY”,“STREET”,“STRENGTH”,“STRIKE”,“STRONG”,“STRONGLY”,“STRUCTURE”,“STUDENT”,“STUDIO”,“STUDY”,“STUFF”,“STYLE”,“SUBJECT”,“SUBSTANTIAL”,“SUCCEED”,“SUCCESS”,“SUCCESSFUL”,“SUCH”,“SUDDENLY”,“SUFFER”,“SUFFICIENT”,“SUGGEST”,“SUGGESTION”,“SUITABLE”,“SUM”,“SUMMER”,“SUN”,“SUPPLY”,“SUPPORT”,“SUPPOSE”,“SURE”,“SURELY”,“SURFACE”,“SURPRISE”,“SURROUND”,“SURVEY”,“SURVIVE”,“SWITCH”,“SYSTEM”,“TABLE”,“TAKE”,“TALK”,“TALL”,“TAPE”,“TARGET”,“TASK”,“TAX”,“TEA”,“TEACH”,“TEACHER”,“TEACHING”,“TEAM”,“TEAR”,“TECHNICAL”,“TECHNIQUE”,“TECHNOLOGY”,“TELEPHONE”,“TELEVISION”,“TELL”,“TEMPERATURE”,“TEND”,“TERM”,“TERMS”,“TERRIBLE”,“TEST”,“TEXT”,“THAN”,“THANK”,“THANKS”,“THAT”,“THE”,“THEATRE”,“THEIR”,“THEM”,“THEME”,“THEMSELVES”,“THEN”,“THEORY”,“THERE”,“THEREFORE”,“THESE”,“THEY”,“THIN”,“THING”,“THINK”,“THIS”,“THOSE”,“THOUGH”,“THOUGHT”,“THREAT”,“THREATEN”,“THROUGH”,“THROUGHOUT”,“THROW”,“THUS”,“TICKET”,“TIME”,“TINY”,“TITLE”,“TO”,“TODAY”,“TOGETHER”,“TOMORROW”,“TONE”,“TONIGHT”,“TOO”,“TOOL”,“TOOTH”,“TOP”,“TOTAL”,“TOTALLY”,“TOUCH”,“TOUR”,“TOWARDS”,“TOWN”,“TRACK”,“TRADE”,“TRADITION”,“TRADITIONAL”,“TRAFFIC”,“TRAIN”,“TRAINING”,“TRANSFER”,“TRANSPORT”,“TRAVEL”,“TREAT”,“TREATMENT”,“TREATY”,“TREE”,“TREND”,“TRIAL”,“TRIP”,“TROOP”,“TROUBLE”,“TRUE”,“TRUST”,“TRUTH”,“TRY”,“TURN”,“TWICE”,“TYPE”,“TYPICAL”,“UNABLE”,“UNDER”,“UNDERSTAND”,“UNDERSTANDING”,“UNDERTAKE”,“UNEMPLOYMENT”,“UNFORTUNATELY”,“UNION”,“UNIT”,“UNITED”,“UNIVERSITY”,“UNLESS”,“UNLIKELY”,“UNTIL”,“UP”,“UPON”,“UPPER”,“URBAN”,“US”,“USE”,“USED”,“USEFUL”,“USER”,“USUAL”,“USUALLY”,“VALUE”,“VARIATION”,“VARIETY”,“VARIOUS”,“VARY”,“VAST”,“VEHICLE”,“VERSION”,“VERY”,“VIA”,“VICTIM”,“VICTORY”,“VIDEO”,“VIEW”,“VILLAGE”,“VIOLENCE”,“VISION”,“VISIT”,“VISITOR”,“VITAL”,“VOICE”,“VOLUME”,“VOTE”,“WAGE”,“WAIT”,“WALK”,“WALL”,“WANT”,“WAR”,“WARM”,“WARN”,“WASH”,“WATCH”,“WATER”,“WAVE”,“WAY”,“WE”,“WEAK”,“WEAPON”,“WEAR”,“WEATHER”,“WEEK”,“WEEKEND”,“WEIGHT”,“WELCOME”,“WELFARE”,“WELL”,“WEST”,“WESTERN”,“WHAT”,“WHATEVER”,“WHEN”,“WHERE”,“WHEREAS”,“WHETHER”,“WHICH”,“WHILE”,“WHILST”,“WHITE”,“WHO”,“WHOLE”,“WHOM”,“WHOSE”,“WHY”,“WIDE”,“WIDELY”,“WIFE”,“WILD”,“WILL”,“WIN”,“WIND”,“WINDOW”,“WINE”,“WING”,“WINNER”,“WINTER”,“WISH”,“WITH”,“WITHDRAW”,“WITHIN”,“WITHOUT”,“WOMAN”,“WONDER”,“WONDERFUL”,“WOOD”,“WORD”,“WORK”,“WORKER”,“WORKING”,“WORKS”,“WORLD”,“WORRY”,“WORTH”,“WOULD”,“WRITE”,“WRITER”,“WRITING”,“WRONG”,“YARD”,“YEAH”,“YEAR”,“YES”,“YESTERDAY”,“YET”,“YOU”,“YOUNG”,“YOUR”,“YOURSELF”,“YOUTH”,0};

My answer to the question are ” Reaction” or “Creation”, but when I type it into the answer. It shows up as a wrong answer. Well, before I plan to do this project. I knew that there would be a time that I could not solve the problem. May be I could not do as Alexandra said, I come. I see. I conquer.

But I have my own words, I came. I assimilated. I synthesized.

Thanksgiving Coding

Hello everybody. Currently I am enjoying my thanksgiving break, but I just found out that I forgot to post the answer codes for the problem 21.  Let’s me provide you this code as the present of Thanksgiving. (Sorry for the late post).

The problem is not so hard. The only difficulty in the problem in that you do need to count twice for the each pairs.

Here is the code with my little notations:

//

//  main.cpp

//  c++

//

//  Created by 柏林 on 14-8-17.

//  Copyright (c) 2014 柏林. All rights reserved.

//

#include <iostream>

int s;

int sum1(int x)

{int t=0;

    for (s=1;s<=x/2;s++){                   // the function for system to run

        if (x%s==0){                        // sort out the proper divisions for the number

            t=t+s;

        }

    }

    return t;

}

int main(int argc, const char * argv[]) {

    int i,q=0;//=sum1(8);                   // set the loop for system to run

    for (i=1;i<10000;i++) {

        int z=sum1(i);

        if((sum1(z)==i)&&(i!=z)){              // add up each number that fits the condision

            q=q+i;

            printf(“%d\n”,i);

         

        }

    }   printf(“%d\n”,q);

    getchar();

    return 0;

}

Remember you never could do much things during the break whatever how well you planned before the break. Just enjoy your break and relax for the next week!! Peace!!!

A BIG CHALLENGE

After finishing some simple problems, I believe it is the time for me to take a really hard and difficult problem to challenge myself. Therefore I run a code for random number, and I get 98.

Ok, let’s go to problem 98 to take a look.

The problem looks like this:

By replacing each of the letters in the word CARE with 1, 2, 9, and 6 respectively, we form a square number: 1296 = 362. What is remarkable is that, by using the same digital substitutions, the anagram, RACE, also forms a square number: 9216 = 962. We shall call CARE (and RACE) a square anagram word pair and specify further that leading zeroes are not permitted, neither may a different letter have the same digital value as another letter.

Using word.txt (right click and ‘Save Link/Target As…’), a 16K text file containing nearly two-thousand common English words, find all the square anagram word pairs (a palindromic word is NOT considered to be an anagram of itself).

What is the largest square number formed by any member of such a pair?

NOTE: All anagrams formed must be contained in the given text file.

The context in word.txt really freak me out:

"A","ABILITY","ABLE","ABOUT","ABOVE","ABSENCE","ABSOLUTELY","ACADEMIC","ACCEPT","ACCESS","ACCIDENT","ACCOMPANY","ACCORDING","ACCOUNT","ACHIEVE","ACHIEVEMENT","ACID","ACQUIRE","ACROSS","ACT","ACTION","ACTIVE","ACTIVITY","ACTUAL","ACTUALLY","ADD","ADDITION","ADDITIONAL","ADDRESS","ADMINISTRATION","ADMIT","ADOPT","ADULT","ADVANCE","ADVANTAGE","ADVICE","ADVISE","AFFAIR","AFFECT","AFFORD","AFRAID","AFTER","AFTERNOON","AFTERWARDS","AGAIN","AGAINST","AGE","AGENCY","AGENT","AGO","AGREE","AGREEMENT","AHEAD","AID","AIM","AIR","AIRCRAFT","ALL","ALLOW","ALMOST","ALONE","ALONG","ALREADY","ALRIGHT","ALSO","ALTERNATIVE","ALTHOUGH","ALWAYS","AMONG","AMONGST","AMOUNT","AN","ANALYSIS","ANCIENT","AND","ANIMAL","ANNOUNCE","ANNUAL","ANOTHER","ANSWER","ANY","ANYBODY","ANYONE","ANYTHING","ANYWAY","APART","APPARENT","APPARENTLY","APPEAL","APPEAR","APPEARANCE","APPLICATION","APPLY","APPOINT","APPOINTMENT","APPROACH","APPROPRIATE","APPROVE","AREA","ARGUE","ARGUMENT","ARISE","ARM","ARMY","AROUND","ARRANGE","ARRANGEMENT","ARRIVE","ART","ARTICLE","ARTIST","AS","ASK","ASPECT","ASSEMBLY","ASSESS","ASSESSMENT","ASSET","ASSOCIATE","ASSOCIATION","ASSUME","ASSUMPTION","AT","ATMOSPHERE","ATTACH","ATTACK","ATTEMPT","ATTEND","ATTENTION","ATTITUDE","ATTRACT","ATTRACTIVE","AUDIENCE","AUTHOR","AUTHORITY","AVAILABLE","AVERAGE","AVOID","AWARD","AWARE","AWAY","AYE","BABY","BACK","BACKGROUND","BAD","BAG","BALANCE","BALL","BAND","BANK","BAR","BASE","BASIC","BASIS","BATTLE","BE","BEAR","BEAT","BEAUTIFUL","BECAUSE","BECOME","BED","BEDROOM","BEFORE","BEGIN","BEGINNING","BEHAVIOUR","BEHIND","BELIEF","BELIEVE","BELONG","BELOW","BENEATH","BENEFIT","BESIDE","BEST","BETTER","BETWEEN","BEYOND","BIG","BILL","BIND","BIRD","BIRTH","BIT","BLACK","BLOCK","BLOOD","BLOODY","BLOW","BLUE","BOARD","BOAT","BODY","BONE","BOOK","BORDER","BOTH","BOTTLE","BOTTOM","BOX","BOY","BRAIN","BRANCH","BREAK","BREATH","BRIDGE","BRIEF","BRIGHT","BRING","BROAD","BROTHER","BUDGET","BUILD","BUILDING","BURN","BUS","BUSINESS","BUSY","BUT","BUY","BY","CABINET","CALL","CAMPAIGN","CAN","CANDIDATE","CAPABLE","CAPACITY","CAPITAL","CAR","CARD","CARE","CAREER","CAREFUL","CAREFULLY","CARRY","CASE","CASH","CAT","CATCH","CATEGORY","CAUSE","CELL","CENTRAL","CENTRE","CENTURY","CERTAIN","CERTAINLY","CHAIN","CHAIR","CHAIRMAN","CHALLENGE","CHANCE","CHANGE","CHANNEL","CHAPTER","CHARACTER","CHARACTERISTIC","CHARGE","CHEAP","CHECK","CHEMICAL","CHIEF","CHILD","CHOICE","CHOOSE","CHURCH","CIRCLE","CIRCUMSTANCE","CITIZEN","CITY","CIVIL","CLAIM","CLASS","CLEAN","CLEAR","CLEARLY","CLIENT","CLIMB","CLOSE","CLOSELY","CLOTHES","CLUB","COAL","CODE","COFFEE","COLD","COLLEAGUE","COLLECT","COLLECTION","COLLEGE","COLOUR","COMBINATION","COMBINE","COME","COMMENT","COMMERCIAL","COMMISSION","COMMIT","COMMITMENT","COMMITTEE","COMMON","COMMUNICATION","COMMUNITY","COMPANY","COMPARE","COMPARISON","COMPETITION","COMPLETE","COMPLETELY","COMPLEX","COMPONENT","COMPUTER","CONCENTRATE","CONCENTRATION","CONCEPT","CONCERN","CONCERNED","CONCLUDE","CONCLUSION","CONDITION","CONDUCT","CONFERENCE","CONFIDENCE","CONFIRM","CONFLICT","CONGRESS","CONNECT","CONNECTION","CONSEQUENCE","CONSERVATIVE","CONSIDER","CONSIDERABLE","CONSIDERATION","CONSIST","CONSTANT","CONSTRUCTION","CONSUMER","CONTACT","CONTAIN","CONTENT","CONTEXT","CONTINUE","CONTRACT","CONTRAST","CONTRIBUTE","CONTRIBUTION","CONTROL","CONVENTION","CONVERSATION","COPY","CORNER","CORPORATE","CORRECT","COS","COST","COULD","COUNCIL","COUNT","COUNTRY","COUNTY","COUPLE","COURSE","COURT","COVER","CREATE","CREATION","CREDIT","CRIME","CRIMINAL","CRISIS","CRITERION","CRITICAL","CRITICISM","CROSS","CROWD","CRY","CULTURAL","CULTURE","CUP","CURRENT","CURRENTLY","CURRICULUM","CUSTOMER","CUT","DAMAGE","DANGER","DANGEROUS","DARK","DATA","DATE","DAUGHTER","DAY","DEAD","DEAL","DEATH","DEBATE","DEBT","DECADE","DECIDE","DECISION","DECLARE","DEEP","DEFENCE","DEFENDANT","DEFINE","DEFINITION","DEGREE","DELIVER","DEMAND","DEMOCRATIC","DEMONSTRATE","DENY","DEPARTMENT","DEPEND","DEPUTY","DERIVE","DESCRIBE","DESCRIPTION","DESIGN","DESIRE","DESK","DESPITE","DESTROY","DETAIL","DETAILED","DETERMINE","DEVELOP","DEVELOPMENT","DEVICE","DIE","DIFFERENCE","DIFFERENT","DIFFICULT","DIFFICULTY","DINNER","DIRECT","DIRECTION","DIRECTLY","DIRECTOR","DISAPPEAR","DISCIPLINE","DISCOVER","DISCUSS","DISCUSSION","DISEASE","DISPLAY","DISTANCE","DISTINCTION","DISTRIBUTION","DISTRICT","DIVIDE","DIVISION","DO","DOCTOR","DOCUMENT","DOG","DOMESTIC","DOOR","DOUBLE","DOUBT","DOWN","DRAW","DRAWING","DREAM","DRESS","DRINK","DRIVE","DRIVER","DROP","DRUG","DRY","DUE","DURING","DUTY","EACH","EAR","EARLY","EARN","EARTH","EASILY","EAST","EASY","EAT","ECONOMIC","ECONOMY","EDGE","EDITOR","EDUCATION","EDUCATIONAL","EFFECT","EFFECTIVE","EFFECTIVELY","EFFORT","EGG","EITHER","ELDERLY","ELECTION","ELEMENT","ELSE","ELSEWHERE","EMERGE","EMPHASIS","EMPLOY","EMPLOYEE","EMPLOYER","EMPLOYMENT","EMPTY","ENABLE","ENCOURAGE","END","ENEMY","ENERGY","ENGINE","ENGINEERING","ENJOY","ENOUGH","ENSURE","ENTER","ENTERPRISE","ENTIRE","ENTIRELY","ENTITLE","ENTRY","ENVIRONMENT","ENVIRONMENTAL","EQUAL","EQUALLY","EQUIPMENT","ERROR","ESCAPE","ESPECIALLY","ESSENTIAL","ESTABLISH","ESTABLISHMENT","ESTATE","ESTIMATE","EVEN","EVENING","EVENT","EVENTUALLY","EVER","EVERY","EVERYBODY","EVERYONE","EVERYTHING","EVIDENCE","EXACTLY","EXAMINATION","EXAMINE","EXAMPLE","EXCELLENT","EXCEPT","EXCHANGE","EXECUTIVE","EXERCISE","EXHIBITION","EXIST","EXISTENCE","EXISTING","EXPECT","EXPECTATION","EXPENDITURE","EXPENSE","EXPENSIVE","EXPERIENCE","EXPERIMENT","EXPERT","EXPLAIN","EXPLANATION","EXPLORE","EXPRESS","EXPRESSION","EXTEND","EXTENT","EXTERNAL","EXTRA","EXTREMELY","EYE","FACE","FACILITY","FACT","FACTOR","FACTORY","FAIL","FAILURE","FAIR","FAIRLY","FAITH","FALL","FAMILIAR","FAMILY","FAMOUS","FAR","FARM","FARMER","FASHION","FAST","FATHER","FAVOUR","FEAR","FEATURE","FEE","FEEL","FEELING","FEMALE","FEW","FIELD","FIGHT","FIGURE","FILE","FILL","FILM","FINAL","FINALLY","FINANCE","FINANCIAL","FIND","FINDING","FINE","FINGER","FINISH","FIRE","FIRM","FIRST","FISH","FIT","FIX","FLAT","FLIGHT","FLOOR","FLOW","FLOWER","FLY","FOCUS","FOLLOW","FOLLOWING","FOOD","FOOT","FOOTBALL","FOR","FORCE","FOREIGN","FOREST","FORGET","FORM","FORMAL","FORMER","FORWARD","FOUNDATION","FREE","FREEDOM","FREQUENTLY","FRESH","FRIEND","FROM","FRONT","FRUIT","FUEL","FULL","FULLY","FUNCTION","FUND","FUNNY","FURTHER","FUTURE","GAIN","GAME","GARDEN","GAS","GATE","GATHER","GENERAL","GENERALLY","GENERATE","GENERATION","GENTLEMAN","GET","GIRL","GIVE","GLASS","GO","GOAL","GOD","GOLD","GOOD","GOVERNMENT","GRANT","GREAT","GREEN","GREY","GROUND","GROUP","GROW","GROWING","GROWTH","GUEST","GUIDE","GUN","HAIR","HALF","HALL","HAND","HANDLE","HANG","HAPPEN","HAPPY","HARD","HARDLY","HATE","HAVE","HE","HEAD","HEALTH","HEAR","HEART","HEAT","HEAVY","HELL","HELP","HENCE","HER","HERE","HERSELF","HIDE","HIGH","HIGHLY","HILL","HIM","HIMSELF","HIS","HISTORICAL","HISTORY","HIT","HOLD","HOLE","HOLIDAY","HOME","HOPE","HORSE","HOSPITAL","HOT","HOTEL","HOUR","HOUSE","HOUSEHOLD","HOUSING","HOW","HOWEVER","HUGE","HUMAN","HURT","HUSBAND","I","IDEA","IDENTIFY","IF","IGNORE","ILLUSTRATE","IMAGE","IMAGINE","IMMEDIATE","IMMEDIATELY","IMPACT","IMPLICATION","IMPLY","IMPORTANCE","IMPORTANT","IMPOSE","IMPOSSIBLE","IMPRESSION","IMPROVE","IMPROVEMENT","IN","INCIDENT","INCLUDE","INCLUDING","INCOME","INCREASE","INCREASED","INCREASINGLY","INDEED","INDEPENDENT","INDEX","INDICATE","INDIVIDUAL","INDUSTRIAL","INDUSTRY","INFLUENCE","INFORM","INFORMATION","INITIAL","INITIATIVE","INJURY","INSIDE","INSIST","INSTANCE","INSTEAD","INSTITUTE","INSTITUTION","INSTRUCTION","INSTRUMENT","INSURANCE","INTEND","INTENTION","INTEREST","INTERESTED","INTERESTING","INTERNAL","INTERNATIONAL","INTERPRETATION","INTERVIEW","INTO","INTRODUCE","INTRODUCTION","INVESTIGATE","INVESTIGATION","INVESTMENT","INVITE","INVOLVE","IRON","IS","ISLAND","ISSUE","IT","ITEM","ITS","ITSELF","JOB","JOIN","JOINT","JOURNEY","JUDGE","JUMP","JUST","JUSTICE","KEEP","KEY","KID","KILL","KIND","KING","KITCHEN","KNEE","KNOW","KNOWLEDGE","LABOUR","LACK","LADY","LAND","LANGUAGE","LARGE","LARGELY","LAST","LATE","LATER","LATTER","LAUGH","LAUNCH","LAW","LAWYER","LAY","LEAD","LEADER","LEADERSHIP","LEADING","LEAF","LEAGUE","LEAN","LEARN","LEAST","LEAVE","LEFT","LEG","LEGAL","LEGISLATION","LENGTH","LESS","LET","LETTER","LEVEL","LIABILITY","LIBERAL","LIBRARY","LIE","LIFE","LIFT","LIGHT","LIKE","LIKELY","LIMIT","LIMITED","LINE","LINK","LIP","LIST","LISTEN","LITERATURE","LITTLE","LIVE","LIVING","LOAN","LOCAL","LOCATION","LONG","LOOK","LORD","LOSE","LOSS","LOT","LOVE","LOVELY","LOW","LUNCH","MACHINE","MAGAZINE","MAIN","MAINLY","MAINTAIN","MAJOR","MAJORITY","MAKE","MALE","MAN","MANAGE","MANAGEMENT","MANAGER","MANNER","MANY","MAP","MARK","MARKET","MARRIAGE","MARRIED","MARRY","MASS","MASTER","MATCH","MATERIAL","MATTER","MAY","MAYBE","ME","MEAL","MEAN","MEANING","MEANS","MEANWHILE","MEASURE","MECHANISM","MEDIA","MEDICAL","MEET","MEETING","MEMBER","MEMBERSHIP","MEMORY","MENTAL","MENTION","MERELY","MESSAGE","METAL","METHOD","MIDDLE","MIGHT","MILE","MILITARY","MILK","MIND","MINE","MINISTER","MINISTRY","MINUTE","MISS","MISTAKE","MODEL","MODERN","MODULE","MOMENT","MONEY","MONTH","MORE","MORNING","MOST","MOTHER","MOTION","MOTOR","MOUNTAIN","MOUTH","MOVE","MOVEMENT","MUCH","MURDER","MUSEUM","MUSIC","MUST","MY","MYSELF","NAME","NARROW","NATION","NATIONAL","NATURAL","NATURE","NEAR","NEARLY","NECESSARILY","NECESSARY","NECK","NEED","NEGOTIATION","NEIGHBOUR","NEITHER","NETWORK","NEVER","NEVERTHELESS","NEW","NEWS","NEWSPAPER","NEXT","NICE","NIGHT","NO","NOBODY","NOD","NOISE","NONE","NOR","NORMAL","NORMALLY","NORTH","NORTHERN","NOSE","NOT","NOTE","NOTHING","NOTICE","NOTION","NOW","NUCLEAR","NUMBER","NURSE","OBJECT","OBJECTIVE","OBSERVATION","OBSERVE","OBTAIN","OBVIOUS","OBVIOUSLY","OCCASION","OCCUR","ODD","OF","OFF","OFFENCE","OFFER","OFFICE","OFFICER","OFFICIAL","OFTEN","OIL","OKAY","OLD","ON","ONCE","ONE","ONLY","ONTO","OPEN","OPERATE","OPERATION","OPINION","OPPORTUNITY","OPPOSITION","OPTION","OR","ORDER","ORDINARY","ORGANISATION","ORGANISE","ORGANIZATION","ORIGIN","ORIGINAL","OTHER","OTHERWISE","OUGHT","OUR","OURSELVES","OUT","OUTCOME","OUTPUT","OUTSIDE","OVER","OVERALL","OWN","OWNER","PACKAGE","PAGE","PAIN","PAINT","PAINTING","PAIR","PANEL","PAPER","PARENT","PARK","PARLIAMENT","PART","PARTICULAR","PARTICULARLY","PARTLY","PARTNER","PARTY","PASS","PASSAGE","PAST","PATH","PATIENT","PATTERN","PAY","PAYMENT","PEACE","PENSION","PEOPLE","PER","PERCENT","PERFECT","PERFORM","PERFORMANCE","PERHAPS","PERIOD","PERMANENT","PERSON","PERSONAL","PERSUADE","PHASE","PHONE","PHOTOGRAPH","PHYSICAL","PICK","PICTURE","PIECE","PLACE","PLAN","PLANNING","PLANT","PLASTIC","PLATE","PLAY","PLAYER","PLEASE","PLEASURE","PLENTY","PLUS","POCKET","POINT","POLICE","POLICY","POLITICAL","POLITICS","POOL","POOR","POPULAR","POPULATION","POSITION","POSITIVE","POSSIBILITY","POSSIBLE","POSSIBLY","POST","POTENTIAL","POUND","POWER","POWERFUL","PRACTICAL","PRACTICE","PREFER","PREPARE","PRESENCE","PRESENT","PRESIDENT","PRESS","PRESSURE","PRETTY","PREVENT","PREVIOUS","PREVIOUSLY","PRICE","PRIMARY","PRIME","PRINCIPLE","PRIORITY","PRISON","PRISONER","PRIVATE","PROBABLY","PROBLEM","PROCEDURE","PROCESS","PRODUCE","PRODUCT","PRODUCTION","PROFESSIONAL","PROFIT","PROGRAM","PROGRAMME","PROGRESS","PROJECT","PROMISE","PROMOTE","PROPER","PROPERLY","PROPERTY","PROPORTION","PROPOSE","PROPOSAL","PROSPECT","PROTECT","PROTECTION","PROVE","PROVIDE","PROVIDED","PROVISION","PUB","PUBLIC","PUBLICATION","PUBLISH","PULL","PUPIL","PURPOSE","PUSH","PUT","QUALITY","QUARTER","QUESTION","QUICK","QUICKLY","QUIET","QUITE","RACE","RADIO","RAILWAY","RAIN","RAISE","RANGE","RAPIDLY","RARE","RATE","RATHER","REACH","REACTION","READ","READER","READING","READY","REAL","REALISE","REALITY","REALIZE","REALLY","REASON","REASONABLE","RECALL","RECEIVE","RECENT","RECENTLY","RECOGNISE","RECOGNITION","RECOGNIZE","RECOMMEND","RECORD","RECOVER","RED","REDUCE","REDUCTION","REFER","REFERENCE","REFLECT","REFORM","REFUSE","REGARD","REGION","REGIONAL","REGULAR","REGULATION","REJECT","RELATE","RELATION","RELATIONSHIP","RELATIVE","RELATIVELY","RELEASE","RELEVANT","RELIEF","RELIGION","RELIGIOUS","RELY","REMAIN","REMEMBER","REMIND","REMOVE","REPEAT","REPLACE","REPLY","REPORT","REPRESENT","REPRESENTATION","REPRESENTATIVE","REQUEST","REQUIRE","REQUIREMENT","RESEARCH","RESOURCE","RESPECT","RESPOND","RESPONSE","RESPONSIBILITY","RESPONSIBLE","REST","RESTAURANT","RESULT","RETAIN","RETURN","REVEAL","REVENUE","REVIEW","REVOLUTION","RICH","RIDE","RIGHT","RING","RISE","RISK","RIVER","ROAD","ROCK","ROLE","ROLL","ROOF","ROOM","ROUND","ROUTE","ROW","ROYAL","RULE","RUN","RURAL","SAFE","SAFETY","SALE","SAME","SAMPLE","SATISFY","SAVE","SAY","SCALE","SCENE","SCHEME","SCHOOL","SCIENCE","SCIENTIFIC","SCIENTIST","SCORE","SCREEN","SEA","SEARCH","SEASON","SEAT","SECOND","SECONDARY","SECRETARY","SECTION","SECTOR","SECURE","SECURITY","SEE","SEEK","SEEM","SELECT","SELECTION","SELL","SEND","SENIOR","SENSE","SENTENCE","SEPARATE","SEQUENCE","SERIES","SERIOUS","SERIOUSLY","SERVANT","SERVE","SERVICE","SESSION","SET","SETTLE","SETTLEMENT","SEVERAL","SEVERE","SEX","SEXUAL","SHAKE","SHALL","SHAPE","SHARE","SHE","SHEET","SHIP","SHOE","SHOOT","SHOP","SHORT","SHOT","SHOULD","SHOULDER","SHOUT","SHOW","SHUT","SIDE","SIGHT","SIGN","SIGNAL","SIGNIFICANCE","SIGNIFICANT","SILENCE","SIMILAR","SIMPLE","SIMPLY","SINCE","SING","SINGLE","SIR","SISTER","SIT","SITE","SITUATION","SIZE","SKILL","SKIN","SKY","SLEEP","SLIGHTLY","SLIP","SLOW","SLOWLY","SMALL","SMILE","SO","SOCIAL","SOCIETY","SOFT","SOFTWARE","SOIL","SOLDIER","SOLICITOR","SOLUTION","SOME","SOMEBODY","SOMEONE","SOMETHING","SOMETIMES","SOMEWHAT","SOMEWHERE","SON","SONG","SOON","SORRY","SORT","SOUND","SOURCE","SOUTH","SOUTHERN","SPACE","SPEAK","SPEAKER","SPECIAL","SPECIES","SPECIFIC","SPEECH","SPEED","SPEND","SPIRIT","SPORT","SPOT","SPREAD","SPRING","STAFF","STAGE","STAND","STANDARD","STAR","START","STATE","STATEMENT","STATION","STATUS","STAY","STEAL","STEP","STICK","STILL","STOCK","STONE","STOP","STORE","STORY","STRAIGHT","STRANGE","STRATEGY","STREET","STRENGTH","STRIKE","STRONG","STRONGLY","STRUCTURE","STUDENT","STUDIO","STUDY","STUFF","STYLE","SUBJECT","SUBSTANTIAL","SUCCEED","SUCCESS","SUCCESSFUL","SUCH","SUDDENLY","SUFFER","SUFFICIENT","SUGGEST","SUGGESTION","SUITABLE","SUM","SUMMER","SUN","SUPPLY","SUPPORT","SUPPOSE","SURE","SURELY","SURFACE","SURPRISE","SURROUND","SURVEY","SURVIVE","SWITCH","SYSTEM","TABLE","TAKE","TALK","TALL","TAPE","TARGET","TASK","TAX","TEA","TEACH","TEACHER","TEACHING","TEAM","TEAR","TECHNICAL","TECHNIQUE","TECHNOLOGY","TELEPHONE","TELEVISION","TELL","TEMPERATURE","TEND","TERM","TERMS","TERRIBLE","TEST","TEXT","THAN","THANK","THANKS","THAT","THE","THEATRE","THEIR","THEM","THEME","THEMSELVES","THEN","THEORY","THERE","THEREFORE","THESE","THEY","THIN","THING","THINK","THIS","THOSE","THOUGH","THOUGHT","THREAT","THREATEN","THROUGH","THROUGHOUT","THROW","THUS","TICKET","TIME","TINY","TITLE","TO","TODAY","TOGETHER","TOMORROW","TONE","TONIGHT","TOO","TOOL","TOOTH","TOP","TOTAL","TOTALLY","TOUCH","TOUR","TOWARDS","TOWN","TRACK","TRADE","TRADITION","TRADITIONAL","TRAFFIC","TRAIN","TRAINING","TRANSFER","TRANSPORT","TRAVEL","TREAT","TREATMENT","TREATY","TREE","TREND","TRIAL","TRIP","TROOP","TROUBLE","TRUE","TRUST","TRUTH","TRY","TURN","TWICE","TYPE","TYPICAL","UNABLE","UNDER","UNDERSTAND","UNDERSTANDING","UNDERTAKE","UNEMPLOYMENT","UNFORTUNATELY","UNION","UNIT","UNITED","UNIVERSITY","UNLESS","UNLIKELY","UNTIL","UP","UPON","UPPER","URBAN","US","USE","USED","USEFUL","USER","USUAL","USUALLY","VALUE","VARIATION","VARIETY","VARIOUS","VARY","VAST","VEHICLE","VERSION","VERY","VIA","VICTIM","VICTORY","VIDEO","VIEW","VILLAGE","VIOLENCE","VISION","VISIT","VISITOR","VITAL","VOICE","VOLUME","VOTE","WAGE","WAIT","WALK","WALL","WANT","WAR","WARM","WARN","WASH","WATCH","WATER","WAVE","WAY","WE","WEAK","WEAPON","WEAR","WEATHER","WEEK","WEEKEND","WEIGHT","WELCOME","WELFARE","WELL","WEST","WESTERN","WHAT","WHATEVER","WHEN","WHERE","WHEREAS","WHETHER","WHICH","WHILE","WHILST","WHITE","WHO","WHOLE","WHOM","WHOSE","WHY","WIDE","WIDELY","WIFE","WILD","WILL","WIN","WIND","WINDOW","WINE","WING","WINNER","WINTER","WISH","WITH","WITHDRAW","WITHIN","WITHOUT","WOMAN","WONDER","WONDERFUL","WOOD","WORD","WORK","WORKER","WORKING","WORKS","WORLD","WORRY","WORTH","WOULD","WRITE","WRITER","WRITING","WRONG","YARD","YEAH","YEAR","YES","YESTERDAY","YET","YOU","YOUNG","YOUR","YOURSELF","YOUTH"

Do you still have any interest in looking my senior project yet? Do you enjoy looking at each characters and symbols in the codes? Do you understand how hard to even read the problem?

All of above are the fun part of writing codes. You love it and also hate it.

I have no idea about how to do it yet. The first thing that appears in my mind is to study how to take data from outside to be used in the Xcode.

Hope you will enjoy reading this article. I will post soon once I make any progress

Largest prime factor

I believe that everybody are familiar with the prime number. For those don’t, I am glad to help you out. A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself. A natural number greater than 1 that is not a prime number is called a composite number.

A quick question! What is the only even number in the prime numbers? Yeah, the answer is 2. Until now, there is not many great solutions to get every prime factor of a huge number. Therefore, I choose today’s question, because I could practice how to get every prime factor of a not so big number, and also try to come up a new way to get the solutions for the large numbers.

Here comes the question:

The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?

It is easier to explain in the code, which is

//
//  main.cpp
//  problem 3
//
//  Created by dev-bolin on 11/10/14.
//  Copyright (c) 2014 dev-bolin. All rights reserved.
//
#include <iostream>
using namespace std;
int main ()
{
    long long primeof  = (600851475143);            //set the number in the question
    int num = 2;                                    // the first prime is 2
    
    while ((num * num) <= primeof)                  // set the upper limit for the loop
        
        if (primeof % num == 0)                     // find the prime of the big number
        {
            cout << num << endl;
            primeof /= num;
        }else
            num++;                                  // try next number
    
    printf("%ld",primeof);                          // get the answer

}

Although we could use the prime easily in the daily mathematics, we still could not explore all the secrets from the numbers, and which is the interesting part that I am going to do in the college. Hope I will do well!!!!

Even Fibonacci numbers

The deadline for Preliminary Approval to Present is this wednesday; therefore, I have to rush to finish a couple of questions to get approval for the first round. So, this time I am doing some easy problems. BUT!!! It is also interesting.

I believe that every body have heard of the famous Fibonacci numbers, which in mathematics, the Fibonacci numbers or Fibonacci sequence are the numbers in the following integer sequence: 1,1,2,3,5,8,13,21,34,55,89,144; or (often, in modern usage): 0,1,1,2,3,5,8,13,21,34,55,89,144.The Fibonacci sequence is named after Fibonacci. His 1202 book Liber Abaci introduced the sequence to Western European mathematics,[5] although the sequence had been described earlier in Indian mathematics.

I guess this number is one of the number theory, which is so fascinating that makes up of the mathematic world. I am so glad that I could meet a problem like that.

Here is the problem from projecteuler:

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, …

By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

For me, the most difficulty in this problem is to find the even number of the Fibonacci number, which is not so hard. Just divide every number by 2, and see if there is a reminder of the number.If not, just add those number together.

Here is the code:

//

//  main.cpp

//  problem 2

//

//  Created by dev-bolin on 11/09/14.

//  Copyright (c) 2014 dev-bolin. All rights reserved.

//

#include “stdlib.h”

#include “stdio.h”

int x = 1;                                  //x and y are initials

int y = 2;

int z;                                      //z is the third number

int sum;                                    //the sum of even numbers

int main()

{

   

    

    for(y = 1; y <= 4000000;) {             // set the loop for the laptop to run

        

        z = x + y;

        x = y;

        y = z;

        if(y % 2 == 0) {                    // get the only even numbers

            sum += y;

        }

    }

    printf (“%d”,sum);                      //well done

    return 0;

}

Ok. Thank you for watching my performance. I will bring next question in a few days.

Lattice paths

This time I found a very interesting question when I was doing Mathlete in my school. It was a problem about finding different ways to get the final corner of a 9*9 grid. Wait !!! I believe that human mind could only do limited mathematics problem, but computer can do billion times more. Luckily I find a problem on the eular that has similar questions.

Here it comes !!!!!!!

Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.

How many such routes are there through a 20×20 grid?

If one choose to use only one’s mind to solve this problem, I believe that it will at least take him a month to do that. However, the answer almost immediately appear on the screen, when I finished the codes.

Let’s appreciate the hard work from computer.

#include <iostream>

using namespace std;                                //all symbols in that namespace will become visible without adding the namespace prefix.

#define limit 20                                    // the conditions of the grid

long long grid[21][21];                             // set the loop for system to run

long long walk(int x, int y) {

    if (x > limit || y > limit) return 0;           //set the maixum limit for the loop

    if (x == limit && y == limit) return (1);

    if (grid[x][y] != 0) return grid[x][y];         //the start requirements

    long long result = 0;

    result += walk(x, y+1);                         // let the system try the routes!!!

    result += walk(x+1, y);

    grid[x][y] = result;

    return grid[x][y];

}

int main() {

    

    cout << 2 * walk(1, 0) << endl;                 // get the answer

    return (0);

}

The only thing I do in the code is that let computer record each route that point go through. That’s it.

Sometimes I am lost in the power of  computers, and I believe that a lot of people could not live without using computer everyday, but I know that since computers are created by human beings, there always be a solution to each problems, even cutting off power source of the world.

A quick glance

This post is not talking about my final code of problem 21. I found this problem is not as simple as I thought before. I am still working on it.

Here is the problem:

Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).
If d(a) = b and d(b) = a, where ab, then a and b are an amicable pair and each of a and b are called amicable numbers.

For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; therefore d(220) = 284. The proper divisors of 284 are 1, 2, 4, 71 and 142; so d(284) = 220.

Evaluate the sum of all the amicable numbers under 10000.

 

Leave your comments, if you have any suggestions.

The Leap Year

When Mathematic combines with computer science, more interesting problems could be solved. For example, this time I solve a Maths problem that relates to the leap year. I believe that everybody should be familiar that during the leap year, February has one more day than usual. But do you know there is more about the leap year.

Here comes the problem:

“You are given the following information, but you may prefer to do some research for yourself.

  • 1 Jan 1900 was a Monday.
  • Thirty days has September,
    April, June and November.
    All the rest have thirty-one,
    Saving February alone,
    Which has twenty-eight, rain or shine.
    And on leap years, twenty-nine.
  • A leap year occurs on any year evenly divisible by 4, but not on a century unless it is divisible by 400.

How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?”

When I first looked at the problem, I was shocked, because I believe that it is impossible to solve such question. You cant imagine how hard people solve this question before the invention of computer. Since we have such intelligent machine, the only way to appreciate it is to use it.

Here is my code:

#include <iostream>

int getday(int yy,int mm)

{

    int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; // set the date for different monthes in a year

    if (d[mm]==28){                                    // give the special setting to the leap years

        if(yy%4==0){

            return 29;

        }else{

            return d[mm];

    }

        

    }else{

        return d[mm];

    }

}

int w=2,d=1,m=1,y=1901,sum=0;                          // the beginning date for the question

int main(int argc, const char * argv[]) {

    for (int t=1;t<37000;t++){                         // the loop for finding the sundat that fits the requirement of the problem

        

        if ((d==1)&&(w==7))

        {

            sum++;

        }

        

        

        

        w+=1;

        if(w>7){w=1;}                                  // keep the date running while checking the sunday

        d+=1;

        if (d>getday(y,m)) {

            d=1;

            m+=1;

            if (m>12) {

                m=1;

                y++;

                

                if (y>2000) break;                      // the stop time for the problem

            }

        }

        

    }

    printf (“%d”,sum);                                  // get the answer

    return 0;

}

There was 171 sundays that fits the requirement. How amazing it is!

Things are getting more and more interesting. Currently, I am working on the problem 21 now. Hope I could share it with you this week.

My First “Blood”

For my senior project, I would like to use C++ as my computer language to solve the problems on the projecteluer. Therefore, I am using Xcode as my platform to write my code.

I already finished the very first problem on the website.

Here is the problem:

“If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.”

This is a very simple and easy question, I guess. The only difficulties in this problem is that some of the numbers that are multiples of 3 will be the same numbers that are multiples of 5. This is the tricky part.

Here is my code:

#include <iostream>

int x;                               //the number that is the multiple of 3 or 5 below 1000

int main(int argc, const char * argv[])

{   int SUM=0;                       //the sum for the number that fits the question

    for (x=1;x<1000;x++)             // create a rang for computer to run in order to find the number

        {   if ((x%3==0)||(x%5==0))  // the conditions that the multiple of 3 or 5 below 1000

        { SUM=SUM+x;                 // add up the number that fits

            }

        }

    printf (“%d”,SUM);               // gets the answer

    return 0;

}

The answer is 233168. And I get my first check!!!!

For the following days, I probably will learn more about the C++ skills, and try to do more questions.

~Hello World~

Hi, everyone.

Thanks for passing by and taking a look at my blog. I am a student from Ross School. This blog is the place where I would post my progress about my senior project, which is to combing Mathematics and Computer Programming together to do something CRAZY!!!!!!!!!!!!!

My goal for this project is to finish as many questions as I can on the https://projecteuler.net/problems before the due day.

Since I am new in the computer field, please forgive me for being slow in progress, and I promise that I will learn hard to improve myself.

 

Thanks again,

Bolin Yang