Skip to main content
Code added.
Source Link
user31159
user31159

In case the intermediate result 1 + x^n (1 + x^n (...)) is not required,

n = 3; First@Nest[{1 + x^#[[2]] #[[1]], #[[2]] - 1} &, {1, n}, n] 

where n should be replaced by the number of timesAlternative

A simpler formulation under the function has to apply.same assumption as above

n = 3; Nest[1 + x^(n--) # &, 1, n] 

In case the intermediate result 1 + x^n (1 + x^n (...)) is not required,

First@Nest[{1 + x^#[[2]] #[[1]], #[[2]] - 1} &, {1, n}, n] 

where n should be replaced by the number of times the function has to apply.

In case the intermediate result 1 + x^n (1 + x^n (...)) is not required,

n = 3; First@Nest[{1 + x^#[[2]] #[[1]], #[[2]] - 1} &, {1, n}, n] 

Alternative

A simpler formulation under the same assumption as above

n = 3; Nest[1 + x^(n--) # &, 1, n] 
Source Link
user31159
user31159

In case the intermediate result 1 + x^n (1 + x^n (...)) is not required,

First@Nest[{1 + x^#[[2]] #[[1]], #[[2]] - 1} &, {1, n}, n] 

where n should be replaced by the number of times the function has to apply.