jasser

95 Reputation

4 Badges

1 years, 363 days

MaplePrimes Activity


These are questions asked by jasser

Hello

Beginning with a given real fraction, for example 1/12, I would like to find out the following information about its decimal number (here: 0.0833333...):

- decimal number up to period, here 0.08

- the period if exists, here 3

How to program that in Maple?

Thanks a lot for your help!

How 

Hello

I have a list N with i elements, for example N:=[7,2,4] with i = 3. From another list L I know, that all the elements of N are also elements of L, but I don't know if they are in the same order. For example:

In L1=[2,6,5,7,3,2,9,4] the elements are in the same order, but they are not in L1=[2,1,4,2,6,7,3,9]. 

How to write a program that can say wether the elements are in the correct order or not?

Thanks for your help!

Hello

I would like to compare the digits of two natural numbers p and q first. Then I would like to omit in p and q the digits which they have in common.

Example: p=2345, q=1536

the common digits are 3 and 5. omitted them in both numbers, it will result p'=24 and q'=16.

Thanks for your help!

Hello

I have programs below for the cases n=3 and n=4. If n is increasing by 1, then there is one loop more. As you can see, that additional loop has always the structure:

x[i+1] from ceil(((n-2)*24-d[i])/(n-i)) to x[i]

whereas d[i] is the sum of the values of x before.

Now I want to write "nequaln":=proc(k), which goes through all the values for n from 3 to k and produces a list [a_3,a_4,a_5,...,a_n].

I guess that I need to program a kind of dynamical loop, but I failed completely. May someone help me? That would be very kind.

 

nequal3:=proc()
    local u,v,a_3;
    a_3:=0;
    for u from ceil((3-2)*24/(3-0)) to (3-2)*24-3+1 do
        for v from ceil(((3-2)*24-u)/(3-1)) to u do
            if (3-2)*24-u-v>=1 then
                a_3:=a_3+1;
            end if;
        end do;
    end do;
    print(a_3);
end proc:

 

nequal4:=proc()
    local u,v,w,a_4;
    a_4:=0;
    for u from ceil((4-2)*24/(4-0)) to (4-2)*24-4+1 do
        for v from ceil(((4-2)*24-u)/(4-1)) to u do
            for w from ceil(((4-2)*24-u-v)/(4-2)) to v do
                if (4-2)*24-u-v-w>=1 then
                    a_4:=a_4+1;
                end if;
            end do;
        end do;
    end do;
    print(a_4);
end proc:

Hello

I have a list with n positive integer numbers and a positive integer k.

I would like to write a Malple programm, that calculates, in how many ways k can be written as a sum of numbers in the list.

Easy examles: let the list be [2,3,6,9].

k=9 can be written in 4 ways: 9=9, 9=6+3, 9=3+3+3, 9=3+2+2+2. The result therefore shoud be 4.

k=8 can be written in 3 ways: 8=6+2, 8=3+3+2, 8=2+2+2+2. The result therefore shoud be 3.

Thank you very much your help!

1 2 3 Page 3 of 3