How can I stop caculate value of recursive sequence?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I want to list five terms of a sequence $(u_n)$ with $u_1 = 0$ and $u_n+1= sqrt1 + u_n$. but I don't want to reduce them.
My code
Clear[u];
u[1] := 0;
u[y_] := Sqrt[1 + u[y - 1]]
A = Table[u[k], k, 1, 5]
and got
$left0,1,sqrt2,sqrt1+sqrt2,sqrt1+sqrt1+sqrt2right$
I want to $u_3 = sqrt1 + sqrt1$, $u_4 = sqrt1 + sqrt1+ sqrt1 $.
How to get the form like that?
output-formatting
add a comment |Â
up vote
2
down vote
favorite
I want to list five terms of a sequence $(u_n)$ with $u_1 = 0$ and $u_n+1= sqrt1 + u_n$. but I don't want to reduce them.
My code
Clear[u];
u[1] := 0;
u[y_] := Sqrt[1 + u[y - 1]]
A = Table[u[k], k, 1, 5]
and got
$left0,1,sqrt2,sqrt1+sqrt2,sqrt1+sqrt1+sqrt2right$
I want to $u_3 = sqrt1 + sqrt1$, $u_4 = sqrt1 + sqrt1+ sqrt1 $.
How to get the form like that?
output-formatting
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I want to list five terms of a sequence $(u_n)$ with $u_1 = 0$ and $u_n+1= sqrt1 + u_n$. but I don't want to reduce them.
My code
Clear[u];
u[1] := 0;
u[y_] := Sqrt[1 + u[y - 1]]
A = Table[u[k], k, 1, 5]
and got
$left0,1,sqrt2,sqrt1+sqrt2,sqrt1+sqrt1+sqrt2right$
I want to $u_3 = sqrt1 + sqrt1$, $u_4 = sqrt1 + sqrt1+ sqrt1 $.
How to get the form like that?
output-formatting
I want to list five terms of a sequence $(u_n)$ with $u_1 = 0$ and $u_n+1= sqrt1 + u_n$. but I don't want to reduce them.
My code
Clear[u];
u[1] := 0;
u[y_] := Sqrt[1 + u[y - 1]]
A = Table[u[k], k, 1, 5]
and got
$left0,1,sqrt2,sqrt1+sqrt2,sqrt1+sqrt1+sqrt2right$
I want to $u_3 = sqrt1 + sqrt1$, $u_4 = sqrt1 + sqrt1+ sqrt1 $.
How to get the form like that?
output-formatting
output-formatting
edited 52 mins ago
asked 1 hour ago
minhthien_2016
415310
415310
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
4
down vote
accepted
You can change
u[1] := 1;
to
u[1] := HoldForm[1];
The resulting expression will stay in the form you requested. However, it will not be suitable for computations. It is only usable for display purposes. To make it work for calculations again, apply ReleaseHold
.
add a comment |Â
up vote
2
down vote
One can also use NestList
NestList[Sqrt[1 + #] &, HoldForm@0, 4]
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
You can change
u[1] := 1;
to
u[1] := HoldForm[1];
The resulting expression will stay in the form you requested. However, it will not be suitable for computations. It is only usable for display purposes. To make it work for calculations again, apply ReleaseHold
.
add a comment |Â
up vote
4
down vote
accepted
You can change
u[1] := 1;
to
u[1] := HoldForm[1];
The resulting expression will stay in the form you requested. However, it will not be suitable for computations. It is only usable for display purposes. To make it work for calculations again, apply ReleaseHold
.
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
You can change
u[1] := 1;
to
u[1] := HoldForm[1];
The resulting expression will stay in the form you requested. However, it will not be suitable for computations. It is only usable for display purposes. To make it work for calculations again, apply ReleaseHold
.
You can change
u[1] := 1;
to
u[1] := HoldForm[1];
The resulting expression will stay in the form you requested. However, it will not be suitable for computations. It is only usable for display purposes. To make it work for calculations again, apply ReleaseHold
.
answered 58 mins ago
Szabolcs
153k13417900
153k13417900
add a comment |Â
add a comment |Â
up vote
2
down vote
One can also use NestList
NestList[Sqrt[1 + #] &, HoldForm@0, 4]
add a comment |Â
up vote
2
down vote
One can also use NestList
NestList[Sqrt[1 + #] &, HoldForm@0, 4]
add a comment |Â
up vote
2
down vote
up vote
2
down vote
One can also use NestList
NestList[Sqrt[1 + #] &, HoldForm@0, 4]
One can also use NestList
NestList[Sqrt[1 + #] &, HoldForm@0, 4]
answered 39 mins ago


ΑλÎÂξανδÃÂο Ζεγγ
1,892721
1,892721
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182230%2fhow-can-i-stop-caculate-value-of-recursive-sequence%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password