Skip to main content

core language - Defining indefinitely many functions


Is it possible to define a class of indefinitely many functions f1, f2, f3, ... such that f1[x] becomes x + 1, f2[x] becomes x + 2, f3[x] becomes x + 3 and so on.


I want f25[100] to produce 125, and f255555555[333] to produce 255555888.


I am aware of the following: If I define



f[n_][x_] := n + x 

then f[1][x] becomes x + 1, f[2][x] becomes x + 2 and so on. But, f[1] is longer and looks messier than f1.


I want my functions names to be f1, f2, f3, ... not f[1], f[2], f[3] ....




Comments