Items tagged with sequence sequence Tagged Items Feed




Bellow I have an example of my current problem:

I want to put a sequence of numbers in the place of Tau in the same command, so that it returns the answers in the same line divided by commas. On the picture I've done the closest I could to what I want, but if you know how to solve this, I think it would be cleaner to use an alternative.

Screenshot of the problem

Hello maple prime users

I have used the sequence command and series command in Maple before, but seem to have hit a little hurdle with a particular problem.

I want to run the expression:


   Where F:=(-1)^n*binomial(c,n)*N(a+n):

   Where N(a):=(-1)^n*[evalf(ln(2)) - 1 + 0.5 -1/3 + 1/4 +... + (-1)^a/a]:

I ran a test case using the following code:


for n from 0 to c do
      Seq2:=convert(Seq, `+`);




This works for the case where a =1, but will not work for a>1 as in the N(a+n) sequence it misses out the terms in the series for a-1, a-2 etc.... So when a = 2 it misses out the -1 of the sequence and when a = 3 it misses out the -1 and 1/2. Are there any tips on how to overcome this?


Best regards


- Yeti

Can Maple look for the limit of a sequence  f(n)  for n=1,2,3, ... ? Of course, if there is a limit of the function of continuous argument, the limit of the sequence is the same number. But it is easy to give examples of when there is the limit of the sequence, and the limit of the function does not exist:

assume(n, posint):

 limit(sin((n^2+1)/n*Pi), n=infinity);  # Obviously the correct answer is  0

                            -1 .. 1


I am trying to plot sequence like:



data:=[seq([n,arrayZ[n]], n=1..3000)]:
t1:=plot(data, style=point, symbol = solidcircle, color= red):

but get incorrect first argument error. How to fix this?

PS. In original sequence instead of null I have constant value, but I don't want it in my plot.

(a) Show that if {an} ∞ n=1 is Cauchy then {a 2 n} ∞ n=1 is also Cauchy. (b) Give an example of a Cauchy sequence {a 2 n} ∞ n=1 such that {an} ∞ n=1 is not Cauchy

how can we write a same result n-times near each other

for i from 1 to 4 do       # here the 4 can be a variable and can change...

I need the result to come in that form  :    3  ,  3  ,  3  ,  3
and because the number of times can change i can't just easily write x,x,x,x;

thanks in advance

Determine wether the sequence below converges or diverges, and if it converges, find the limit.





Hi all,


min/max command in Maple can return the minimum/maximum of a sequence or array.

 In my case, I want to find not only the minimum/maximum, but also where are them. How can I do?

For example, there is a squence [1,2,3,7,6,5,4].

Through max([1,2,3,7,6,5,4]), we can get 7.

But I still want to get "4" which is the index value of "7". 


Thank you.


I am required to generate a list containing the square of numbers 1 through k where k is an arbitrary int,defined from 1 to n. To do this, I've currently got the following commands:

local k, mylist:=[];

for k from 1 to n do


end do;

where sumsquare() is a procedure I defined to compute the sum of the squares of 1 through a number passed as an argument

At present this gives me an out of bounds error. 

How can I initialize mylist to be of size n, like in other languages such as C++?


let m3 = [[0; 1; 0]; [1; 0; 1]; [0; 1; 0]]

1. Firstly, express this matrix into sequence function expression

2. how to express this matrix in terms of forloop code

3. for complicated case such as 1 is not in easy pattern, can it intelligently express the matrix in terms of for loop code


is there exist extra tools to express matrix in terms of for loop code or sequence function code?

  • here is an exercise I got from a text book                                                                                                              calculate the first 10 terms of the following sequence :                                                                                              

u[0]=1                                                                                                                                                             u[n+1]=1/2(u[n]+2/u[n]) n>=0                                                                                                                          

  • estimate the differences u[3]-sqrt(2) , u[4]-sqrt(2), u[5]-sqrt(2), and u[6]-sqrt(2) with a precision of 50 numbers                                    
  • what can we conjecture about the sequence ?
  • how to prove that conjecture with MAPLE ?


If I have a list, how can I write a program to see is that list is graphical? So far I have

graphicalseq := proc (L::list)

local i::integer, N;

N := convert(L, `+`);

if type(N, odd) then print("Sequence is not graphical")

else if numelems(L)-1 < L[1] then print("Sequence is not graphical")
end if;

end if;

end proc;

I know I still have to keep going to determine whether the sequence is graphical, but I'm not sure how.

 I was thinking of trying to somehow use Havel-Hakimi's theorem, but again I'm not sure how. Any hints would be appreciated.  I can't use the is Graph Sequence function

I am trying to find a way to take the rows of a matrix and put them in a sequence.  For example if i have the matrix 


I want to rewrite it as S:= {111222333}.  

Sorry if this is not clear.  I know how to create a sequence, but I want to be able to use the Matrix and output a sequence without manually inputing the numbers.  

Thank you in advance for your help.  

RandomCompositions:= proc(n::posint, k::posint)
Compositions:= [seq(C-~1, C= combinat:-composition(n+k, k))],
Rand:= rand(1..nops(Compositions))
()-> Compositions[Rand()]
end proc:

R:= RandomCompositions(9,6):
n:= 2^13:
S:= 'R()' $ n:


I want to compile statistics each number in a sequence cannot  occur  over twice.

The sequences that do not fit the rule above must be ommitted.

The statistic is  Fermi-Dirac statistics.

confused the Bose-Einstein condensation and Fermi-Dirac statistics.

But the theory is right.


Is that possible to get the differences between two sequences directly? (instead of using a list)

I don't quit understand why the second method would collapse the 0s into just a single value. It's not a set.




1 2 3 4 Page 1 of 4