Lua, 77 75 65 bytes
x,v=z.rep,io.read()for a=1,v do print(x(0,a-1)..'1'..x(0,v-a))end
Well, I'm not sure if lua is the best language for this with the two period concatenation... But hey, there's a shot at it. I'll see if there's any improvements to be made.
EDIT:
I figured something out on accident which I find rather odd, but, it works.
In Lua, everyone knows you have the ability to assign functions to variables. This is one of the more useful CodeGolf features.
This means instead of:
string.sub("50", 1, 1) -- = 5
string.sub("50", 2, 2) -- = 0
string.sub("40", 1, 1) -- = 4
string.sub("40", 2, 2) -- = 0
You can do this:
s = string.sub
s("50", 1, 1) -- = 5
s("50", 2, 2) -- = 0
s("40", 1, 1) -- = 4
s("40", 2, 2) -- = 0
But wait, Lua allows some amount of OOP. So you could potentially even do:
z=""
s = z.sub
s("50", 1, 1) -- = 5
s("50", 2, 2) -- = 0
s("40", 1, 1) -- = 4
s("40", 2, 2) -- = 0
That will work as well and cuts characters.
Now here comes the weird part. You don't even need to assign a string at any point. Simply doing:
s = z.sub
s("50", 1, 1) -- = 5
s("50", 2, 2) -- = 0
s("40", 1, 1) -- = 4
s("40", 2, 2) -- = 0
Will work.
So you can visually see the difference, take a look at the golfed results of this:
Using string.sub (88 characters)
string.sub("50", 1, 1)string.sub("50", 2, 2)string.sub("40", 1, 1)string.sub("40", 2, 2)
Assigning string.sub to a variable (65 characters)
s=string.sub s("50", 1, 1)s("50", 2, 2)s("40", 1, 1)s("40", 2, 2)
Assigning string.sub using an OOP approach (64 characters)
z=""s=z.sub s("50", 1, 1)s("50", 2, 2)s("40", 1, 1)s("40", 2, 2)
Assigning string.sub using a.. nil approach? (60 characters)
s=z.sub s("50", 1, 1)s("50", 2, 2)s("40", 1, 1)s("40", 2, 2)
If someone knows why this works, I'd be interested.
1Given an integer input n ... -- I assume you mean a natural number? – Jonathan Frech – 2018-08-28T17:00:41.453