Movatterモバイル変換


[0]ホーム

URL:


WOLFRAM

Wolfram Language & System Documentation Center
Nest

Nest[f,expr,n]

gives an expression withf appliedn times toexpr.

Nest[f,n]

represents an operator form ofNest that can be applied to expressions.

Details
Details and OptionsDetails and Options
Examples  
Basic Examples  
Scope  
Generalizations & Extensions  
Applications  
Properties & Relations  
Neat Examples  
See Also
Tech Notes
Related Guides
Related Links
History
Cite this Page

Nest

Nest[f,expr,n]

gives an expression withf appliedn times toexpr.

Nest[f,n]

represents an operator form ofNest that can be applied to expressions.

Details

  • You can useThrow to exit fromNest before it is finished.»

Examples

open allclose all

Basic Examples  (2)

Applyf tox from 0 to 4 times:

The function to nest can be a pure function:

Scope  (4)

Nesting a function can build a formula:

Nesting can return a single number:

The nested function can operate on a list:

Apply the operator form to different starting expressions:

Generalizations & Extensions  (2)

UseThrow to exit aNest:

To nest a function of more than one argument, the arguments can be put into a list:

Applications  (8)

Continued fraction:

Power tower:

Growth of annually compounded capital in 10 years:

Newton iterations for:

Iterated string replacements:

Consecutive pairs of Fibonacci numbers:

Functional composition for higher-order Newton iteration (for):

Generate a bifurcation diagram for an iterated logistic map:

Properties & Relations  (6)

Nest gives the last element ofNestList:

Nest is effectivelyComposition using the same function multiple times:

UseRSolve to symbolically computeNest operations:

Different length compositions or nests give the same result:

FixedPoint automatically goes on until the result no longer changes:

NestWhile goes on while a condition is true:

Fold automatically inserts second arguments from a list:

Neat Examples  (4)

Binary tree:

Gray codes of length 4:

See Also

NestList NestGraph NestWhile Fold Function FixedPoint Do Composition

Tech Notes

Related Guides

Related Links

History

Introduced in 1988(1.0) |Updated in 1996(3.0)2024(14.1)

Wolfram Research (1988), Nest, Wolfram Language function, https://reference.wolfram.com/language/ref/Nest.html (updated 2024).

Text

Wolfram Research (1988), Nest, Wolfram Language function, https://reference.wolfram.com/language/ref/Nest.html (updated 2024).

CMS

Wolfram Language. 1988. "Nest." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/Nest.html.

APA

Wolfram Language. (1988). Nest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Nest.html

BibTeX

@misc{reference.wolfram_2025_nest, author="Wolfram Research", title="{Nest}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/Nest.html}", note=[Accessed: 29-November-2025]}

BibLaTeX

@online{reference.wolfram_2025_nest, organization={Wolfram Research}, title={Nest}, year={2024}, url={https://reference.wolfram.com/language/ref/Nest.html}, note=[Accessed: 29-November-2025]}

Top

[8]ページ先頭

©2009-2025 Movatter.jp