brian bovril

914 Reputation

16 Badges

18 years, 324 days

MaplePrimes Activity


These are replies submitted by brian bovril

well done Kitonum. this extends this worksheet by Dr Khan

http://www.maplesoft.com/applications/view.aspx?SID=4901

given seeds [25,75,1,8,5,10] and the aim is 863 how can NumbersGame produce a similar output to

(25+75-5)x(10-1)+ 8.

(each seed can only be used as many times as it appears).

@acer nd Kitonum thanks

In case your wondering....

You would get a better response from forum members if you demonstrated you had a go at the problem beforehand, instead of expecting us to do your homework for you.

@acer too easy...

 

Thanks @Carl Love and Kitonum

@Carl Love thanks for your efforts. But can u do it  to suit  M15 cause that's all I've got.

@Carl Love 

Re the aside, maybe I didn't explain myself. Looking at the output of res[2], I want to extract the non-zero answers.
In the above expression, x[3]=6. For ease of reading, I want it to report "30=6x5" or "30=5+5+5+5+5+5".So it needs to map the third prime as a multiple of 6.

As another example, PF(44,10) yields x[1]=1,x[6]=1,x[10]=1. I want "44=2+13+29"

@Carl Love it would be more instructive for maple to report an error or display "undefined" rather than a definative answer like "false".

@Kitonum 

thanks for your interest.

But when i put in these values, unless i've cocked up, the tests for square and triangular number fail:

unprotect(D);
> d:=3515820*n;                             

          5.414603381 10^206543 
> B:= (1243419/585970)*d; D:= (367903/175791)*d; W:= (246821/83710)*d; Y:= (125739/106540)*d; b:= (815541/585970)*d;  w:= (17158/8371)*d; y:= (1813071/1171940)*d;
                                   

> B+D+W+Y+b+d+w+y;
                         7.760263432 10^206544 
> is(sqrt(W+B),integer);
                             false
> is(-3/2+(1/2)*sqrt(1+8*(D+Y)),integer);
                             false

@Kitonum thanks

what about the square and triangular # constraints (see above reply to Carl).

@Carl Love my attempt was to search for solutions in a given space.  But your and Kitonums solutions are better.

what about the second part of his question, the square number and triangular number constaints.

is(sqrt(W+B),integer)=true and is(-3/2+(1/2)*sqrt(1+8*(D+Y)),integer)=true

is it possible to put these into isolve?

i realise the numbers are absolutely massive

 

@Christopher2222 thanks, that works!

@Carl Love my code throws up words like "weird" and "glacier" which contradict the law, but also "receive" and "ceiling" which obey the law.

i only want contradictions, so need code to search the dictionary for words containing "cie" and "ei", then search this sieved list for words containing "cei" and remove them from the output. I think it needs a second loop.

@Christopher2222 thanks.

Thats where the 923 comes from,but I think there is more.  The above code returns words containing CIE, but what about other words like "weird". "i before e.....".

What I want is code to throw out words like "ceiling" which obeys the law, but prints contradictions like "weird" and "glacier".

@acer and C.Love thx

First 13 14 15 16 17 18 19 Last Page 15 of 26