edit: the preceding answer suggests that my browser didn't display the dots, i.e. you really meant the series, not the sequence... Sorry, the below doesn't answer the question.
Does the following look right? (might this be homework?)
(1) -> f n == reduce(+, [binomial(2*i, i)*2^i/3^(2*i) for i in 0..n])
Type: Void
(2) -> guess([f n for n in 0..20], maxLevel==2)
Compiling function f with type NonNegativeInteger -> Fraction(
Integer)
s - 1
21 8p + 12
++-++ 20
4 | | ---------
| | 9p + 18
n - 1 p = 0 20
--+ 20
(2) [ > ------------------- + 1]
--+ 9
s = 0
21
Type: List(Expression(Integer))
(3) -> guessPRec [f n for n in 0..20]
(3)
[
[f(n): (9n + 18)f(n + 2) + (- 17n - 30)f(n + 1) + (8n + 12)f(n)= 0,
13
f(0)= 1, f(1)= --]
9
]
Type: List(Expression(Integer))
In general, it's often a good idea to generalise, i.e., introduce more parameters:
(4) -> f n == reduce(+, [binomial(2*i, i)*x^i/y^(2*i) for i in 0..n])
Compiled code for f has been cleared.
1 old definition(s) deleted for function or rule f
Type: Void
(5) -> guess([f n for n in 0..20], maxLevel==2)
Compiling function f with type NonNegativeInteger -> Fraction(
Polynomial(Integer))
s - 1
21 (4p + 6)x
++-++ 20
2x | | -----------
| | 2
n - 1 p = 0 (p + 2)y
--+ 20 20
(5) [ > ---------------------- + 1]
--+ 2
s = 0 y
21
Type: List(Expression(Integer))
(6) -> guessPRec [f n for n in 0..20]
(6)
[
[
f(n):
2 2
(n + 2)y f(n + 2) + ((- n - 2)y + (- 4n - 6)x)f(n + 1)
+
(4n + 6)x f(n)
=
0
,
2
y + 2x
f(0)= 1, f(1)= -------]
2
y
]
Type: List(Expression(Integer))
No comments:
Post a Comment