brian bovril

889 Reputation

16 Badges

18 years, 302 days

MaplePrimes Activity


These are questions asked by brian bovril

Why can't maple 15 solve this eqn. [n= 10]

solve(ithprime(n)=29,n);

 

According to this site,"It is known that every even number can be written as a sum of at most six primes". 

http://www.theage.com.au/national/education/christians-goldbachs-magic-sum-20140903-3es2t.html

i wanted to test this using maple.

restart:
> PF := proc (a::integer)

> local cst,obj,res;
> cst := add(x[i], i = 1 .. numtheory:-pi(prevprime(a))) <= 6;
> obj := add(x[i]*ithprime(i), i = 1 .. numtheory:-pi(prevprime(a)))-a;
> res := Optimization:-LPSolve(obj, {cst ,obj>=0}, assume={nonnegative,integer}); end proc:
> PF(30);
[0, [x[1] = 0, x[2] = 0, x[3] = 6, x[4] = 0, x[5] = 0, x[6] = 0,x[7] = 0, x[8] = 0, x[9] = 0, x[10] = 0]]

the third prime is 5 and 6 of them make 30. as an aside, it would be nice to know how to get maple to output "30 = 6x5".

this is obviously pretty limited, because 30 can be written as the sum of two primes (7+23 and 11+19) [GOLDBACH], but using DS's GlobalSearch for all solutions takes a long time to compute. also I have to nominate the highest prime.

any suggestions?

ACP.mw

 

hi all

trying to modify some kitonum code to get the smallest solution, d=3,515,820, but i have problem....

http://en.wikipedia.org/wiki/Archimedes'_cattle_problem

 

i_before_e$.mw

My Homies

I'm trying to find words which contradict the rule "i before e except after c". according to BBC program "QI" there are 923 exceptions, but below i get less than that. i guess its only as good as the dictionary, the 'inbuilt' has only 25k words but 'ospd3' (with 80k words) seems to stop before letter Q (with my sledgehammer code) when there are more words out there like "weird", "veil" and "reciept".

with(StringTools); with(PatternDictionary); bid := Create(ospd3);
words :=([seq])(LowerCase(Get(bid, i)), i = 1 .. Size(bid)-1);
tot := 0;
for n to nops(words) do
C := searchtext(cie, words[n]); E := searchtext(ei, words[n]);
if`and`(C = 0, E = 0) then next else tot := tot+1;
print([tot, words[n]]) end if
end do

Whassup homies?

http://www.mathsisfun.com/puzzles/who-lives-in-the-city--solution.html

tried to solve this using C.Loves program, but didn't quite get their solution...

Who_Lives_in_the_Cit.mw

Vars:= [PN,Name, TV, Dest,Ages,Hair,Lives]:
PN:=[$1..5]:
Name:= [Bob, Keeley, Rachael, Eilish, Amy]:
TV:=[Simpsons, Coronation, Eastenders, Desperate, Neighbours]:
Dest:= [Fra, Aus, Eng, Afr,Ita]:
Ages:= [14, 21, 46, 52, 81]:
Hair:=[afro, long, straight, curly , bald]:
Lives:= [town, city, village, farm, youth]:
Con1:= Desperate=3: Con2:= Bob=1: Con3:= NextTo(Simpsons,youth,PN): Con4:= Succ(Afr,Rachael,PN): Con5:= village=52: Con6:= Aus=straight: Con7:= Afr=Desperate: Con8:= 14=5: Con9:= Amy=Eastenders: Con10:= Ita=long: Con11:= Keeley=village: Con12:= bald=46: Con13:= Eng=4: Con14:= NextTo(Desperate,Neighbours,PN): Con15:= NextTo(Coronation,afro,PN): Con16:= NextTo(Rachael,afro,PN): Con17:= 21=youth: Con18:= Coronation=long: Con19:= 81=farm: Con20:= Fra=town: Con21:= Eilish<>straight:

read "LogicProblem.mpl"; City:= LogicProblem(Vars): with(City);

 

First 20 21 22 23 24 25 26 Last Page 22 of 34