Items tagged with integer integer Tagged Items Feed

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?

I'm interested in doing some experimental mathematics using the PSLQ integer relation algorithm.  The only third-party program for doing PSLQ problems I've been able to find is a GNU C++ program with a less-than-user-friendly command-line interface.  I've heard that Maple implements PSLQ and I like the symbolic input and presentation it offers as a CAS, but I can't find any information on which alternative types of Maple 18 make the PSLQ algorithm available.

 

 

so we have to Write a maple function with -> that takes an integer N and a boolean function

F: {(i,j) l 0<= i,j<= N} -> {true,false} 


and returns a list containing all [i,j] such that F(i,j). A procedure that does this
would be


proc(N,F) local i, j, RV;
RV:=NULL;
for i from 1 to N do for j from 1 to N do
if F(i,j) then RV:=RV,[i,j] ; end if ;
end do ; end do ;
return RV ;
end proc ;


The problem is to do this inline, i.e. you have to write
(i,j)-> ...

 

please help...

Hi

I have been trying to find a way to present results from engineering calcs to 2 decimal places (i.e.: 350.50) but the round function rounds to the nearest integer. Is there a specific statement for specifying the number of decimal places you want to present some results?

thanks

How to find 2013th term in the sequence 

1, 2, 2, 3, 3, 3, 4, 4, 4, 4, ...?

in which the n-th positive integer appears n times. 

I don't know how to start.

In geom3d. I want to find the vertices A(x1,y1,z1), B(x2,y2,z2), where x1, y1, z1, x2, y2, z2 are integer numbers so that the triangle OAB  (O is origin) and perimeter and area are integer numbers. I tried

> resrart:

N:=5:

L:=[]:

for x1 from -N to N do

for y1 from x1 to N do

for z1 from y1 to N do

for x2 from -N to N do

for y2 from -N to N do

for z2 from -N to N do

a:=sqrt(x1^2+y1^2+z1^2):b:=sqrt(x2^2+y2^2+z2^2):c:=sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2):

p:=(a+b+c)/2:

S:=sqrt(p*(p-a)*(p-b)*(p-c)):

if type(2*p, integer) and type(S, posint)

then L:=[op(L), [[0, 0, 0], [x1, y1, z1], [x2, y2, z2]]]: fi:

od: od: od: od: od: od:

nops(L);

But my computer runs too long. I can not receive the result. How to get the answer?

If I the length of the side are 6, 25, 29. I tried 

DirectSearch:-SolveEquations([(x2-x1)^2+(y2-y1)^2+(z2-z1)^2 = 6^2, (x3-x2)^2+(y3-y2)^2+(z3-z2)^2 = 25^2,  (x3-x1)^2+(y3-y1)^2+(z3-z1)^2 = 29^2], {abs(x1) <= 30, abs(x2) <= 20, abs(x3) <= 20, abs(y1) <= 20, abs(y2) <= 20, abs(y3) <= 20, abs(z1) <= 20,abs(z2) <= 20, abs(z3) <= 20}, assume = integer, AllSolutions, solutions = 1);

 

 

I've been given a question:

Let pn denote the nth prime number. Then p1 = 2, p2 = 3, p3 = 5, p4 = 7, p5 = 11, . . . .

It is known that the infinite sum 1/p1 + 1/p2 + 1/p3 + · · · + 1/pn + · · · = infinity.

Find the smallest positive integer N so that 1/p1 + 1/p2 +1/p3 + · · · + 1/pN−1 + 1/pN > e. [Hint : ithprime(n) generates the nth prime number.]

How do I start off?

Many thanks!

In an atomic physics calculation involving the quantum theory of angular momentum, there appear polynomials whose coefficients involve square roots of positive integers, for example

sqrt(6)-sqrt(2)*sqrt(3) 

Maple does not cancel such an expression to zero because the code allows for the possibility that a square root can be positive or negative.  In the physics context all these square roots are positive.  Is there some simple way to induce Maple...

Since it is not possible for me to reply directly in that new Maple Primes:
I branched. Feel free to re-join for a reasonable structure. What a mess.

http://www.mapleprimes.com/questions/145527-Is-This-Matrix-Primitive

 

I am rusty on such (may be it is 'obvious' via Lie theory). Your group is just the
group of invertible matrices over the integers (this follows from algebra). And as

   Let GL(2,Z) be the  group of all the matrices of dimension 2 over the integers with the determinant equal to +/-1.
   A matrix M in GL(2,Z) is called primitive if M is not equal to K^n for any K in GL(2,Z) and any positive integer n >= 2.
   Is the matrix M:= Matrix([[27,5],[11,2]]) primitive? How to determine it in Maple?

Edit. GL(2,Z) instead of UL(2,Z).

Dear friends,

I am reporting with a brief comment concerning the integral int(1/(1+x^a), x=0..infinity) with a>=2 a real number. This was evaluated here.

Now Maple 15 (X86 64 LINUX) will quite happily compute this in its most simple form involving the sine when a is not a positive integer or a rational number. If it is, however, a beta function term results,...

Dear friends,

this is to share with you what a joy it was to work with Maple on the problem of enumerating non-isomorphic graphs. This problem goes back to Polya and Harary and it is a beautiful example of Polya counting, while also being of notable simplicity, so that a high school student or an undergraduate can follow it easily.

I have worked on this problem over the years, adapting my solutions in Cocoa and Lisp as I gained insights. My first attempt used...

I want to find a triangle with the vertices A(x1, y1, z1), B(x2, y2, z2), C(x3, y3, z3) knowing that the point G(1,1,1) is centroid of the triagle ABC and x1, y1, z1, x2, y2, z2, x3, y3, z3 are integer numbers, but I can not find. How do I tell Maple to do that? 

Hello, I have a set of equations, and I want to solve it over the integers (mod 13). But msolve command fails. Here is my code:

eq:={a4*a1-11, a4*a2-12, a4*a3-6, a5*a1-3, a5*a2-8, a5*a3-4, a6*a1-2, a6*a2-1, a6*a3-7};
msolve(eq,13);

It fails, but I can solve it manually. Here is a solution:

a4*a1 = 11 => a4:=1 and a1:=11

a4*a2 = 12 => a2:=12

a4*a3 = 6 => a3:=6

a5*a1 = 3 => a5:=3/11 mod 13 = 5

a5*a2 = 8 => a2:=8/5 mod 13 = 12

1 2 3 4 5 6 7 Last Page 1 of 22