Items tagged with integer integer Tagged Items Feed

Hello, I run Maple to solve Binary Integer Programming problem which contain about 1340 constraint and its goal to maximize the objective function.

At first, it's running for 2 hours and said that the iteration limit was reached. So I try to add 'iterationlimit' at LPSolve opts and set it to 10000, but after 3 or 4 hours it said that the iteration limit was reached. So I set 'iterationlimit' to 100000000 and now Maple keep evaluating more than 12 hours.

I run Maple at my notebook with these spesification:

Processor: Intel Corei3-5005U 2.0 GHz

Memory: 4GB RAM

Windows 10

 

It is normal? Or I must run Maple in higher notebook spesification?

Thank you in advance.

 

Below is my Maple file, hope you can help me.

ISL_2017_FASE3.mw

I apologize, as I'm still very new. I've flipped through a lot of pages, but I'm unsure of how Maple code translates to Maple TA.

 

I have randomly assigned an integer for the value of a year in Maple TA. I'd like it to appear as "2013" for example, but it will instead appear as "2,013". Is there a way to set the output formatting of a variable individually within a problem in TA?

Thanks!


Dear all,

I wold like to find the solution of the next system of two equations with three unknowns but we assume that the unknows are positive integers. How the following code can work. Many thanks

 

 

 

> restart;
> assume(J, integer, J >= 0);
> assume(A, integer, A >= 0);
> assume(T, integer, T >= 0);
> eq1 := J+10*A+50*T=500;
   eq2 := J+A+T = 100;
  solve( {eq1,eq2},{J,A,T});

if you want a random interger between 0 and 100

what will be the command?

Hi Maple Primes

I have this parabola -

y2:=6z^2 +z+244;

x2:=9z^2+3z+367;

I use the eliminate command to write without z;

c:=eliminate([y=y2,x=x2],z);

Then I have the expression

e2 = 4x^2-12xy+9y^2-7x+9y+369.

My questions is, what integer values for x and y are on the curve e2?

I think the answer may be exactly when z is an integer.

How could I determine this given only e2?

Regards,
Matt

>nombor1:=[4,6,2];

nombor1:=[4,6,2]

 

Hi, anyone know hot i need to continue my command to get 462 from [4,6,2]?

Thank you~=]]

>mylist:=468;

mylist:=468

 

Hi, how i need to continue my command to get [4,6,8] from 468?

Thank you~=]]

I use Mathematica. This code finds integer points on the sphere

(x-2)^2 + (y-4)^2 + (c-6)^2 =15

and select two of them so that distance of two this points equal to 4.

ClearAll[a, b, r, c];
a = 2;
b = 4;
c = 6;
r = 15; ss =
Subsets[{x, y, z} /.
Solve[{(x \[Minus] a)^2 + (y \[Minus] b)^2 + (z \[Minus] c)^2 ==
r^2, x != a, y != b, z != c, x y z != 0}, {x, y, z},
Integers], {2}];
t = Select[ss, And @@ Unequal @@@ Subsets[Flatten[#], {2}] &];
Length[t]
Select[ss, Apply[EuclideanDistance, #] === 4 &]

 

and this code select four points on the shere so that none of three points make a right triangle

ClearAll[a, b, r, c];
a = 2;
b = 4;
c = 6;
r = 15;
ss = Subsets[{x, y, z} /.
Solve[{(x - a)^2 + (y - b)^2 + (z - c)^2 == r^2, x != a, y != b,
z != c, x y z != 0, x > y}, {x, y, z}, Integers], {4}];
nonright =
Pick[ss, (FreeQ[#, \[Pi]/2] &) /@ ({VectorAngle[#2 - #1, #3 - #1],
VectorAngle[#1 - #2, #3 - #2],
VectorAngle[#1 - #3, #2 - #3]} & @@@ ss)];
Select[nonright, (12 == Length[Union @@ #] &)]

 I am looking for a  procedure in Maple.  I have some problems with this sphere. For example:

Choose four points so that 12 coordinates difference and it makes a square.

Can your code improve with sphere?

When I use the option assume = nonnegint or integervariables = {...} in Optimization[Minimize], or Optimization[LPSolve] I've got the message "kernel connection lost'. 

 

Thie even happens when I use the simple example from the Maple help:

with(Optimization):
LPSolve(2*x+5*y,{3*x-y=1,x-y<=5},assume={nonnegative,integer});

 

It says; mserver.exe has stopped working. 

What's wrong? 

How can I generate some n-tuple random list of integers s.t. any component is between -30 and 50? For example if n=5 then four random of such 5-tuple are

[-1,2,8,7,9] , [0,-9,2,-3,-5] , [4,5,3,-8,-1] , [12, -5, 0, 6,8]

Let x and y be 4-digit integers such that the last digit of x is 7 and the last digit of y is 1. That is, x = abc7 and y = rst1, where a,b,c,r,s,t all run from 0 to 9. There are 1000 possibilities for x and  1000 for y. What are all possible products x*y? I would like all possible products listed in increasing order. The first element of the list should be 7*1 = 7 (since 0007*0001 = 7). The last should be 9997*9991 = 99880027. Thank you! 

How to find the maximum natural number n s. t. the sum of its cubed digits is greater than or equal to n? Of course, with Maple. The same question for the sum of the  digits to k-th power. Here are my unsuccessful attempts:
1.Optimization:-Maximize(n, {n <= convert(map(c ->c^3, convert(n, base, 10)), `+`)}, assume = integer);

Error, invalid input: `convert/base` expects its 1st argument, n, to be of type {integer, list(integer)}, but received n


2. for n while n <= convert(map(c ->c^3, convert(n, base, 10)), `+`) do print(n) end do;

                               1
                               2
                               3
                               4
                               5
                               6
                               7
                               8
                               9

Let M and K be given positive integers.

I struggle with how to write efficiently this formula in Maple,mainly because it sums over *pairs* of integers K1 and K2, with the given property that "K1+2*K2=K":

0<=K1<=K,

0<=K2<=K/2

 

sum { M!/(M-K1-K2)! * K!/(K1! * K2)! * 1/M^K * 1/2^K2 : such that K1 + 2*K2 = K}

The "!" means factorial.

I currently have a function quadsum(n) that determines the [x,y] solutions of the above equation for an integer n. :

quadsum:= proc(n::nonnegint)
local
k:= 0, mylist:= table(),
x:= isqrt(iquo(n,2)), y:= x, x2:= x^2, y2:= y^2;
if 2*x2 <> n then x:= x+1; x2:= x2+2*x-1; y:= x; y2:= x2; end if;
while x2 <= n do
y:= isqrt(n-x2); y2:= y^2;
if x2+y2 = n then k:= k+1; mylist[k]:= [x,y] end if;
x:= x+1; x2:= x2+2*x-1;
end do;
convert(mylist, list)
end proc:

How would I alter this so that I get [x,y] for n= (5^a).(13^b).(17^c)(29^d) for non-negative integers a,b,c,d?

1.  a procedure quadsumstats whose input is an integer n. This procedure should return a list of length 

n whose kth  entry is the number of solutions to
x^2 + y^2 = k 
for
1 <= k and k <= n

I am sort of confused as to how to construct that list of length n and how to obtain integer solutions to the equation in maple.

2.

a procedure firstCount(k) that finds the first integer
n
with
k
representations as
"x^2+y^2= n." What does it mean for an integer to have k representations?

 

 

 

 

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