daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. nesting[f_,k_] := Nest[f,#,k]&
  2. => nesting[f,3][Pi] = f[f[f[Pi]]]
  3.    
  4. nesting[f_,k_] := nesting[f,k-1]
  5. nesting[f,1] := f[#]&
  6.    
  7. => nesting[f,3][Pi] = f[f[f[#1]&]]][Pi]
  8.    
  9. nesting[f,3] = f[f[f[#1]]]&
  10.    
  11. nesting[f_,k_] := nesting[f,k-1]&
  12. nesting[f,1] := f[#]
  13.    
  14. nesting[f,3] = nesting[f,3-1]&
  15. nesting[f,3][Pi] = nesting[f,2-1]&
  16.    
  17. Clear@nest;
  18. nest[f_, 1] := f;
  19. nest[f_, k_] := f@*nest[f, k - 1];
  20.    
  21. Clear@nest;
  22. nest[f_, 1] := f[#]&;
  23. nest[f_, k_] := f[nest[f, k - 1][#]] &;
  24.    
  25. Clear@nest;
  26. nest[f_, 1][arg_] := f[arg];
  27. nest[f_, k_][arg_] := nest[f, k - 1][f[arg]];
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top