Ask Your Question
1

finding general term of a sequence

asked 6 years ago

rewi gravatar image

I have a sequence of numbers 1,34,1136,25288,1377200,. Now can we have a sage code that can give the n th term of this sequence..

Preview: (hide)

Comments

Please give us the formula for the n.th term of this or an other sequence, we will try to implement it in one line. Else the question is not well defined.

dan_fulea gravatar imagedan_fulea ( 6 years ago )

There is no "the nth term" for a sequence like you've given with ... . For example: 1,2,3,.... could be the sequence f(n)=n or it could be f(n)=n^3-6n^2+12n-6. There are actually an infinite number of formulas that could work here.

dazedANDconfused gravatar imagedazedANDconfused ( 6 years ago )

Of course there are infinitely many ways to continue a sequence.

One can still understand the question as "Find a reasonable guess of what this sequence might be, and give the next term for that guess".

The Online encyclopedia of integer sequences (OEIS) has a collection of such reasonable guesses.

slelievre gravatar imageslelievre ( 6 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 6 years ago

slelievre gravatar image

Searching the numerators and denominators in the Online encyclopedia of integer sequences (OEIS):

the sequence might be un=H(n)/n! where H(n)=k=1..n1/k is the n-th harmonic number.

sage: def u(n):
....:     return sum(1/i for i in (1 .. n))/factorial(n)
....:
sage: [u(n) for n in (1 .. 8)]
[1, 3/4, 11/36, 25/288, 137/7200, 49/14400, 121/235200, 761/11289600]

There are of course many other "natural" possibilities.

Preview: (hide)
link

Comments

1

For the OP: Sage ships with the command oeis to play with directly in the REPL, eg.

sage: oeis([1, 4, 36, 288, 7200], max_results=2)
0: A277174: a(n) = Product_{i=1..n} i*rad(i) where rad(n) = A007947(n).
1: A316297: a(n) = n! times the denominator of the n-th harmonic number H(n).
mforets gravatar imagemforets ( 6 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 6 years ago

Seen: 726 times

Last updated: Nov 07 '18