1
$\begingroup$
Eout = E^x ;
For[kz = 1, kz < 4, kz++, 
  Print[Eout1[kz] = Eout];
  Print[kz]]

The output is

E^x
1
E^x
2
E^x
3

But what I want to have is

E^x
1
E^x.E^x
2
E^x.E^x.E^x
3

Is it possible to get the desired output by using Table or a loop with Do or While?

$\endgroup$
7
  • 1
    $\begingroup$ Welcome! Start with the tour, How to Ask, and the help center. Always edit if improvable, show due diligence, give brief context, include minimal working example of code and data in formatted form. By doing all this you help us to help you and likely you will inspire great answers. The site depends on participation, as you receive give back: vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned. $\endgroup$ Commented Jul 12, 2019 at 12:58
  • 3
    $\begingroup$ Have you seen the Mathematica function called Nest? Also NestList Would that solve your problem? Try NestList[Times[Exp[x], #] &, E0, 5] $\endgroup$ Commented Jul 12, 2019 at 13:00
  • 2
    $\begingroup$ Fold and FoldList could also be of interest here, in case the second argument $e^x$ changes from one step to the next. Because multiplying repeatedly by the same factor can be abbreviated by a power construct: $e^x\cdot e^x=e^{2x}$ etc. very generally, even if $x$ is a matrix. $\endgroup$ Commented Jul 12, 2019 at 13:12
  • $\begingroup$ This will not work. $\endgroup$ Commented Jul 12, 2019 at 13:23
  • 3
    $\begingroup$ Glad it helped, just a heads up: Your question may be put on-hold as it seems to be off-topic (see the help center), i.e it arises from a simple mistake and is unlikely to help any future visitors. In this case you where missing a function that is easily found in the documentation. Don't be discouraged by that cleaning-up policy. Your future good questions (see How to Ask) are welcome. Learn about common pitfalls. And do take the tour! $\endgroup$ Commented Jul 12, 2019 at 13:41

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.