# Print 0 to 100 without 1-9 characters

Print integers 0 to 100 (inclusive) without using characters 123456789 in your code.

Separator of numbers can be comma or white space (by default <blank>, <horizontal tabulator>, <newline>, <carriage return>, <form feed> or <vertical tabulator>).

Shortest code wins.

• Many tricks are made possible by allowing 0. Which is what makes this challenge interesting, IMO. Commented Feb 23, 2021 at 17:08
• I thought "do X without Y" questions weren't allowed anymore. Commented Feb 24, 2021 at 3:34
• @PurpleP They're allowed, but discouraged. Interesting ones are fine. Commented Feb 25, 2021 at 0:06
• Is there a requirement to stop printing at 100? Commented Feb 25, 2021 at 16:44
• Can I use non-ASCII encoding?
– user100411
Commented Oct 17, 2021 at 20:36

# R, 9 bytes

F:volcano


Try it online!

The sequence operator : coerces its arguments to integers. F is the boolean FALSE, which gets coerced to 0. volcano is one of the many built-in datasets (it gives topographic information about Maunga Whau in New Zealand); since it is a matrix, : fetches the value at position [1, 1] which is luckily equal to 100. The code is therefore equivalent to 0:100.

This answer was inspired by a conversation with Giuseppe and Kirill L. in the comments under Giuseppe's R answer.

• I thought Mathematica had weird builtins. Why is volcano specifically about Maunga Whau in New Zealand? Commented Feb 23, 2021 at 20:27
• @cairdcoinheringaahing This dataset was digitized by Ross Ihaka, a New Zealand statistician and one of the creators of R, who then included it in R as a good example for a contour map. I don't know why he chose that volcano; maybe he lived nearby, or maybe that was just the first map he found! Commented Feb 23, 2021 at 20:58
• @Giuseppe I tried that, but volcano is the only dataset whose first entry is in $[100, 101)$. Using anything else than the first entry leads to at least 9 bytes, even for a dataset with a 3-character name (e.g. sum(BOD) or npk[pi], which don't give 100 anyway). I don't think it can get shorter using this approach. Commented Feb 24, 2021 at 7:08
• Not that it'd change your byte-count, but you could've just used 0 - the rules only say 1-9 are forbidden... Commented Feb 24, 2021 at 21:45
• Just impressed by the beauty of this answer! Commented Mar 7, 2021 at 16:47

# Python 3: 2723 20 Bytes

Thanks to caird coinheringaahing for -4 bytes, ovs for -3 bytes

print(*range(*b'e'))


I'm pretty poor at golfing, so there's probably a better way to do this.

TIO

• 23 bytes Commented Feb 23, 2021 at 15:53
• Hey @DonThousand, I accidentally downvoted your submission, my bad, i was upvoting, but it was a misclick, i have fixed my mistake, sorry again.
– user100752
Commented Feb 23, 2021 at 15:55
• You can replace ord('e') with *b'e' for -3 bytes.
– ovs
Commented Feb 23, 2021 at 16:01
• Strings with a leading b are objects of type bytes, which behave like lists of integers in many ways. This is doing the same as range(*[101]).
– ovs
Commented Feb 23, 2021 at 16:07
• @aneroid - that would be a snippet rather than a function or program, so would need to be lambda:[*range(*b'e')] to comply with site defaults, making it longer than the full program print(*range(*b'e')). Commented Feb 24, 2021 at 20:30

# brainfuck, 138 bytes

>>++++++++++<<++++++[>>>++++++++<<<-]++++++[>>>>++++++++<<<<-]++++++++++>++++++++++<[>[>>.>.+<<.<-]++++++++++>>>----------<+<<<-]>>>>+.-..


Try it online!

No numbers is pretty easy, but the golf size is not great... :)

I am sure it can be improved, I am really a beginner in using Brainfuck. I wanted to try it anyway.

How it works:

>>++++++++++<<                LF Char (idx2)
++++++[>>>++++++++<<<-]       Zero char tens (idx3)
++++++[>>>>++++++++<<<<-]     Zero char unit (idx4)
+++++ +++++                   10 counter (tens)
>+++++ +++++<                 10 counter (unit)
[>                            Move to the counter
[>>.                        Print the tens
>.+                       Print the unit and increment
<<.                      Print the LF
<-]                    Loop 10 times
+++++ +++++                   Restore the counter
>>>----- -----                Restore the digit
<+                          Increment the tens char
<<<-]                     Loop everything 10 times
>>>>+.-..                     Print 100 using a cell which is already at char 0

• Welcome to the site, and nice first answer! Commented Feb 24, 2021 at 10:09

# JavaScript (V8), 28 bytes

We cannot write $$\100\$$ or $$\101\$$ in hexadecimal with 0's and letters only (0x64 and 0x65 respectively), but we can write $$\202\$$ (0xCA) and use $$\2n<202\$$ as the condition of the for loop.

for(n=0;n+n<0xCA;)print(n++)


Try it online!

### 30 bytes

This version computes $$\10^2\$$ with the hexadecimal representation of $$\10\$$.

for(n=0;n<=0xA*0xA;)print(n++)


Try it online!

### 31 bytes

This version builds the string "100".

for(n=0;n<=-~0+'00';)print(n++)


Try it online!

• The last one could be 1 byte shorter asfor(n=0;n<=0xA+'0';)print(n++). Commented Feb 27, 2021 at 8:46

# SHENZHEN I/O, 61 bytes, 7¥, 7 Lines

@not
@mov acc dat
@not
tgt acc dat
-mov acc p0
slp x0


Outputs 0-100 as simple output, one per time unit. Makes use of the DX300 (XBus <-> Simple Input chip) and LC70G04 (NOT gate), which cost 1¥ each but do not use any power or count as lines of code (the game's measure of code length). These are used to generate a value of 1, which it adds and outputs until it hits 100. The value for 100 is generated using the "not" command, which makes the accumulator 100 if it is value 0, otherwise it sets the acc to 0.

(Not pictured: conversion from simple output to the screen's XBus input, for the visualization.)

# SHENZHEN I/O (MCxxxx ASM only), 129 bytes, 8¥, 16 Lines

@not                 | not
@mov acc p0          | mul acc
@mov acc dat         | dgt 0
@not                 | sub p0
tgt acc dat          | mul acc
-mov acc x0          | mov acc p0
slp p0               | slx x0


Outputs 0-100 as one XBus output each. Uses only programmable MCxxxx chips, no logic gates or other components. Generates value 1 in a pretty interesting way:

not     # acc = 100
mul acc # 100 * 100 = 999 (max value)
dgt 0   # digit 0 of 999 = 9
sub p0  # 9 - 100 = -91
dgt 0   # digit 0 of -91 = -1
mul acc # -1 * -1 = 1

# Jelly, 2 bytes

³Ż


Try it online!

Outputs a list. If the separator must be a single character, 3 bytes

## How it works

³ŻK - Main link. Takes no arguments
³   - Yield 100
Ż  - Range from 0 to 100
K - Join by spaces (optional)

• wtf happens here xD
– azro
Commented Feb 23, 2021 at 18:15
• Languages designed to be used in code golf kinda ruin the aesthetics of code golf. I prefer to see mad-squeezing of daily used languages that are legitimately used in real production environments, instead. Commented Feb 24, 2021 at 16:07
• @MartinBraun In most challenges (I.e. those more complex than this), creating a competitive answer in a golfing language is just as difficult as doing so in a “real” language. You’ll see that I helped golf the Python answer just above (sorting by votes), and I can tell you that was just as simple as writing this answer Commented Feb 24, 2021 at 16:11
• @MartinBraun This opinion has been shared a gazillion times on meta. The consensus is, just look at other answers. The R answer in particular is quite beautiful. Commented Feb 24, 2021 at 17:16
• @Sanctus It is 2 bytes. More specifically, it is the hex bytes 83 D2 (and 4B for the 3 byte version). Jelly uses a custom code page to encode its programs in order to make them more "readable", but if you fed a raw byte stream of those two bytes into the Jelly interpreter, it would produce the same output Commented Feb 26, 2021 at 15:45

# Raku, 10 bytes

put 0..Ⅽ


Try it online!

Ⅽ here is the Unicode character ROMAN NUMERAL ONE HUNDRED.

Any other Unicode character with a defined value of 100 could be used:

௱: TAMIL NUMBER ONE HUNDRED
൱: MALAYALAM NUMBER ONE HUNDRED
፻: ETHIOPIC NUMBER HUNDRED
ⅽ: SMALL ROMAN NUMERAL ONE HUNDRED

All are three UTF-8 bytes long, like Ⅽ.

• Anytime you have 0..foo, you can use ^foo. So you can get 8 bytes with put ^Ⅽ Commented Feb 24, 2021 at 3:08
• @user0721090601 Incorrect. ^foo is the same as 0..(foo-1), not 0..foo.
– Sean
Commented Feb 24, 2021 at 3:54
• Ack, duh. Ignore me Commented Feb 24, 2021 at 4:13
• Are there any Unicode characters with a defined value of 101? If so, puts ^ then the character would save bytes Commented Mar 5, 2021 at 0:51
• @cairdcoinheringaahing I checked that before posting my answer, but there aren't any. Not too surprising, really.
– Sean
Commented Mar 5, 2021 at 1:02

# VyxaljHRM, 0 bytes




Try it Online!

Kinda cheating, but whatever.

## How?

  # full program
# H flag presets the stack to 100
# R flag does range when number is treated as iterable
# M flag makes range start at 0
# j flag joins the top of the stack by newlines


# R, 11 bytes

F:(0xA*0xA)
F:0xA^(T+T)


Try it online!

Uses this tip.

Still being beaten by some volcano in New Zealand, though...

### R, 16 bytes

F:paste0(+T,0,0)


Try it online!

Thanks to Kirill L. for correcting an error.

R's ASCII=>byte function is utf8ToInt, which unfortunately has an 8 in it. Luckily, : will attempt to coerce its arguments to numeric types, so we construct 100 by pasting together +F (which coerces its value to 0) and two 0s. This would also work, though longer, without a 0 as F:paste(+T,+F,+F,sep="").

Possibly there's a very short builtin dataset with a sum that's close to 100, though I haven't been able to find one.

• I believe according to the task, you should start with F rather than T. Commented Feb 23, 2021 at 17:19
• 9 bytes (but yours is much more elegant!) Commented Feb 23, 2021 at 17:31
• @KirillL. oh yes, my mistake. Thanks. Commented Feb 23, 2021 at 17:44
• @Giuseppe, yeah, but F:sum(T|Nile) is still only 13 bytes. Commented Feb 23, 2021 at 17:48
• I found out that the volcano dataset leads to a 9 byte answer, which I posted instead. Commented Feb 23, 2021 at 19:34

# Retina 0.8.2, 3326 24 bytes


,,

,,,,,,
,
,,,,,

$.  Try it online! Explanation: The first stage inserts two commas, which the second stage increases to 20 (it's complicated). The third stage multiplies by 5 to give 100. The last stage then inserts the number of commas so far at each position. • Nice! You can golf it a bit by computing 100 as 4*5*5 tio.run/##K0otycxL/P@fSwcIuHTAFILmUtFL@P8fAA – Leo Commented Feb 23, 2021 at 21:49 • @Leo You should have used 0514150 commas for a nice symmetry! – Neil Commented Feb 23, 2021 at 23:30 • @Leo (Although as it happens I found a shorter solution, which I then verified using a Python script. The only other solution with the same length simply has the first two stages swapped.) – Neil Commented Feb 23, 2021 at 23:40 • As per specification you may not use commas (,). Commented Sep 6, 2023 at 16:00 • @KaiBurghardt I think that's just the way the list of excluded digits is formatted. But you can replace the commas with spaces or ¶s to get an alternative program if you so wish. – Neil Commented Sep 6, 2023 at 17:21 # C (gcc), 38 bytes f(i){for(i=0;printf("%d ",i++)&'#';);}  Try it online! Without using digit 0, it would be 39 bytes: i;main(){for(;printf("%d ",i++)&'#';);} • i as a global defaults to 0 saving a couple characters. Just change your main call to f in your example/ Commented Feb 24, 2021 at 20:58 • Actually took I it further and made it recursive for a 2 more characters saved: Commented Feb 24, 2021 at 21:10 • where did you learn this level of programming i don't even understand it Commented Feb 25, 2021 at 7:59 • @vijaykumar printf returns how many bytes are printed. '#' is as same as number 35 (ASCII 35 for "#"). That's all you need to know to make it work. – tsh Commented Feb 25, 2021 at 8:08 • Capital C would also work - 64+3 = 'C' :) Commented Feb 25, 2021 at 19:21 # Bash, 25 23 bytes seq 0$(printf %d "'d")


Try it online!

-2 thanks to @manatwork

• And we only need the 4 chars $q=0 because null isn't being cast to an int. We can cast to an int to avoid it, but (int) takes 5 bytes. But adding 0 casts to 0, and we can only do that in 2 bytes, though we need to re-add the space after the echo, so it's effectively 3. Still saves us a byte, though! while($q<ord(e))echo 0+$q++." "; (while has the same bytecount as for with just the middle clause used). Commented Feb 25, 2021 at 17:22 # Factor, 46 23 bytes -23 bytes thanks to Bubbler 0xa sq [0,b] [ . ] each  Try it online! I've never written anything in Factor before, but it's a surprisingly fun language. • Thanks for picking up Factor! Lots of golfs are possible on this code. 1) You don't need to dup the 100 in the first place, and then you won't have anything to drop at the end. 2) A range is a sequence, so you can run each on it without >array. 3) There are multiple ways to get the constant 100, such as CHAR: d or 0xa sq. If you want, drop by the Factor chatroom, and I'll explain things further :) Commented Mar 2, 2021 at 8:35 # Zsh, 12 bytes seq 0$[##d]

Attempt This Online!

• seq: count
• from 0
• $[##d]: to the character value of d Alternative: # Zsh, 12 bytes ! seq 0$?00

Attempt This Online!

! does nothing, but fails with exit code 1; $? then retrieves the exit code. # Vyxal, jH, 1 byte ʀ  Try it Online! Flags for the win. The H flag presets the stack to 100, generate range 0 to 100 and then j flag joins on newlines. The flag was around before this challenge too. • This seems to give the wrong output – user7467 Commented Feb 23, 2021 at 22:00 • @Anush its fixed Commented Feb 24, 2021 at 1:53 • +1, first reaction someone seeing this will be "OMGWTFBBQ wat happens here" XD Commented Jun 7, 2021 at 12:19 # Perl, 20, 13, 12, 16 bytes say for 0..ord d  Try it online! • You can get rid of $,=",";, but you need ord('d') for it to work.
– Sake
Commented Feb 23, 2021 at 16:03
• @PaulPicard: unquoted dee works here (perl v5.32.0), e.g. perl -E 'say 0..ord(d)'
– Thor
Commented Feb 23, 2021 at 16:08
• You can remove the parenthesis. Commented Feb 23, 2021 at 16:11
• Without the comma, this doesn't meet the challenge specification to have a separator between numbers. say for 0..ord d would meet the rules. Commented Feb 24, 2021 at 0:01
• @Xcali: indeed, thanks
– Thor
Commented Feb 24, 2021 at 5:18

# Zsh, 16 bytes

echo {0..$[##d]}  Try it online! Only builtins, so no seq For fun, here's a 17 byte answer without 0: echo {$?..$[##d]}  Try it online! Also $! or $# will work as 0 replacements. • Coreutils solution for 14B: jot - 0$[##d] Commented Nov 10, 2021 at 1:55

# Bash, 1816 14 bytes

seq 0 $[++x]00  Try it online! Thanks @manatwork for -2, @Jonah for -2 • You don't need the braces. Commented Feb 27, 2021 at 2:53 • Welcome to Code Golf! Nice first answer. Commented Feb 27, 2021 at 4:14 • seq 0$[++x]00 for 14. Commented Feb 28, 2021 at 3:43

# Bash, 15

seq dc<<<A0Kf


Try it online!

• 1 byte saved, thanks to @manatwork.

# Pure Bash (no external utilities), 23

• 9 bytes saved thanks to @ArcticKona.
eval echo {0..$[++x]00}  Try it online! • Your newest solution skips “0” because you missed a space between seq's parameters. Sorry, that looks like +1 character. ☹ Commented Feb 23, 2021 at 20:28 • @manatwork oops - yes, thanks - fixed. Commented Feb 23, 2021 at 20:30 • As apology, here is a 15 character one, still based on your idea: seq dc<<<A0Kf. Commented Feb 23, 2021 at 20:31 • @manatwork - thanks! Commented Feb 23, 2021 at 20:43 • for pure bash try eval echo {0..$[++x]00} Commented Oct 29, 2021 at 7:40

# PICO-8, 50 45 bytes

i=0-#"0"repeat i+=#"0"?i
until#tostr(i)>#"00"


-5 bytes by replacing print with its shorthand, ?.

Demo (50 byte version; 45 byte version has same output):

• Glad to see some PICO-8 on CGCC! It's such a fun little engine to tinker around with. Commented Nov 3, 2021 at 8:50

# GNU Octave, 14, 5 bytes

0:'d'


TIO by Giuseppe

• I think just 0:'d' should work. Commented Feb 23, 2021 at 16:14
• @Giuseppe: nice one
– Thor
Commented Feb 23, 2021 at 16:17
• Also, Octave is on TIO if you want to add a link :-) Commented Feb 23, 2021 at 16:19

# Ruby22 bytes 12 bytes - thanks to @manatwork

p *0..?d.ord


Try it online!

• A splat * operator will do it instead of .to_a: p *0..?d.ord Commented Feb 23, 2021 at 16:00
• You can switch to Ruby 1.8 and remove the .ord Commented Feb 23, 2021 at 20:02

# 05AB1E, 2 bytes

тÝ


Try it online!

Outputs a list. If the separator must be a single character, 3 bytes

## How it works

тÝ» - Full program
т   - Push 100
Ý  - Range from 0 to 100
» - Join with newlines (optional)


# Deadfish~, 2071 / 8 / 7 bytes

2071 bytes

o{i}c{d}io{i}dc{d}iio{i}ddc{d}iiio{i}dddcddddddoiiiiiicdddddoiiiiicddddoiiiicdddoiiicddoiicdoicociodciioddciiiodddciiiioddddciiiiiodddddciiiiiioddddddc{i}dddo{d}iiic{i}ddo{d}iic{i}do{d}ic{i}o{d}c{i}io{d}dc{i}iio{d}ddc{i}iiio{d}dddc{i}iiiio{d}ddddc{i}iiiiio{d}dddddc{i}iiiiiio{d}ddddddc{i}{i}dddo{d}{d}iiic{i}{i}ddo{d}{d}iic{i}{i}do{d}{d}ic{i}{i}o{d}{d}c{i}{i}io{d}{d}dc{i}{i}iio{d}{d}ddc{i}{i}iiio{d}{d}dddc{i}{i}iiiio{d}{d}ddddc{i}{i}iiiiio{d}{d}dddddc{i}{i}iiiiiio{d}{d}ddddddc{i}{i}{i}dddo{d}{d}{d}iiic{i}{i}{i}ddo{d}{d}{d}iic{i}{i}{i}do{d}{d}{d}ic{i}{i}{i}o{d}{d}{d}c{i}{i}{i}io{d}{d}{d}dc{i}{i}{i}iio{d}{d}{d}ddc{i}{i}{i}iiio{d}{d}{d}dddc{i}{i}{i}iiiio{d}{d}{d}ddddc{i}{i}{i}iiiiio{d}{d}{d}dddddc{i}{i}{i}iiiiiio{d}{d}{d}ddddddc{{i}dddddd}dddo{{d}iiiiii}iiic{{i}dddddd}ddo{{d}iiiiii}iic{{i}dddddd}do{{d}iiiiii}ic{{i}dddddd}o{{d}iiiiii}c{{i}dddddd}io{{d}iiiiii}dc{{i}dddddd}iio{{d}iiiiii}ddc{{i}dddddd}iiio{{d}iiiiii}dddc{{i}dddddd}iiiio{{d}iiiiii}ddddc{{i}dddddd}iiiiio{{d}iiiiii}dddddc{{i}dddddd}iiiiiio{{d}iiiiii}ddddddc{{i}ddddd}dddo{{d}iiiii}iiic{{i}ddddd}ddo{{d}iiiii}iic{{i}ddddd}do{{d}iiiii}ic{{i}ddddd}o{{d}iiiii}c{{i}ddddd}io{{d}iiiii}dc{{i}ddddd}iio{{d}iiiii}ddc{{i}ddddd}iiio{{d}iiiii}dddc{{i}ddddd}iiiio{{d}iiiii}ddddc{{i}ddddd}iiiiio{{d}iiiii}dddddc{{i}ddddd}iiiiiio{{d}iiiii}ddddddc{{i}dddd}dddo{{d}iiii}iiic{{i}dddd}ddo{{d}iiii}iic{{i}dddd}do{{d}iiii}ic{{i}dddd}o{{d}iiii}c{{i}dddd}io{{d}iiii}dc{{i}dddd}iio{{d}iiii}ddc{{i}dddd}iiio{{d}iiii}dddc{{i}dddd}iiiio{{d}iiii}ddddc{{i}dddd}iiiiio{{d}iiii}dddddc{{i}dddd}iiiiiio{{d}iiii}ddddddc{{i}ddd}dddo{{d}iii}iiic{{i}ddd}ddo{{d}iii}iic{{i}ddd}do{{d}iii}ic{{i}ddd}o{{d}iii}c{{i}ddd}io{{d}iii}dc{{i}ddd}iio{{d}iii}ddc{{i}ddd}iiio{{d}iii}dddc{{i}ddd}iiiio{{d}iii}ddddc{{i}ddd}iiiiio{{d}iii}dddddc{{i}ddd}iiiiiio{{d}iii}ddddddc{{i}dd}dddo{{d}ii}iiic{{i}dd}ddo{{d}ii}iic{{i}dd}do{{d}ii}ic{{i}dd}o{{d}ii}c{{i}dd}io{{d}ii}dc{{i}dd}iio{{d}ii}ddc{{i}dd}iiio{{d}ii}dddc{{i}dd}iiiio{{d}ii}ddddc{{i}dd}iiiiio{{d}ii}dddddc{{i}dd}iiiiiio{{d}ii}ddddddc{{i}d}dddo{{d}i}iiic{{i}d}ddo{{d}i}iic{{i}d}do{{d}i}ic{{i}d}o{{d}i}c


Try it online!

8 bytes (if you consider Hello, world! a valid separator)

o{{iow}}


Try it online!

7 bytes (If you don't care about seperators)

o{{io}}


Try it online!

Never thought I'd see deadfish be shorter than, well, anything except Unary.

• Damn it. Rewriting. Commented Feb 24, 2021 at 3:30
• @Razetime Remebered w doesn't care about accumulator. Commented Feb 24, 2021 at 3:32
• "Hello, World!" is not a valid separator. Commented Feb 24, 2021 at 4:10
• Haha reading up on Deadfish~ I realized that exact 7 byte program... but you beat me to it! I actually wrote a Deadfish interpreter for Code Golf that automatically had spaces between output, just because the BASIC interpreter put them there. 😄 Perfect for than program! Commented Mar 7, 2021 at 16:30

# Whitespace, 58 bytes

Another in the theme of "this language doesn't even care about digit characters".





Try it online!

[Push  0
][Label

][Dup
][PrintNum
][Push  10
][PrintChar
][Push  1
][Push  101
][Subtract	  	][JmpNeg

]


Try it online!

# MY BASIC, 29 bytes; BBC BASIC 27 bytes

for i=0 to 0xa*0xa
print i
next


Try it online!

Edit: Thanks for upvoting! I have found there is a BASIC dialect with even shorter syntax for hexadecimals (it's in BBC BASIC):

for i=0 to &a*&a
print i
next


that's minus 2 bytes :)

• Welcome to the site, and nice first answer! Commented Feb 26, 2021 at 15:48
• Doesn't BBC BASIC also have keyword abbreviations e.g. p.i for print i?
– Neil
Commented Mar 8, 2021 at 0:36
• that would normally be done with a question mark: ? i - but not in BBC BASIC Commented Mar 8, 2021 at 19:58

# dc, 13 characters

Thanks to

• Daemon for reusing stack depth instead of getting it again, to use shorter operator (-1 character)
[zpdA0>x]dsxx


Try it online!

### dc, 14 characters

Thanks to

• Digital Trauma for the twist in using the stack depth efficiently (-2 characters)
[zpzA0!<m]dsmx


Try it online!

### dc, 16 characters

0[pz+dA0>i]dsixp


Sample run:

bash-5.0\$ dc -e '0[pz+dA0>i]dsixp' | head
0
1
2
3
4
5
6
7
8
9


Try it online!

• Similar idea, same score Commented Feb 23, 2021 at 20:41
• Thanks @DigitalTrauma. I tried that too earlier, but only now, seeing your suggestion I found the more efficient way. Commented Feb 23, 2021 at 20:54

# Vim, 20 bytes

i0<esc><C-A>s<C-R>=range(<C-R>"0<C-R>")



Try it online!

Trying to improve on Razetime's answer, I stumbled upon the range function, which works wonders for this task. i<C-R>=range(101)\n would print the numbers we want, we just need to be a little creative to do it without 1.

### Explanation

i0<esc><C-A>s<C-R>=range(<C-R>"0<C-R>")
i0<esc>                                    Insert a single 0
<C-A>                               Increase it to a 1
s                              Cut the 1 and go back to insert mode
<C-R>=                        Write the result of the following function
range(             )    A range of numbers from 0 to N-1
<C-R>"            The last text that was deleted (1)
0           0
<C-R>"     1 again

• -4 bytes by using tab autocomplete on the range() function. Also, it doesn't work on TIO, but if you start Vim with the +startinsert flag, you don't need the i at the beginning and save another -1 bytes: vim +startinsert testfile Commented Apr 26, 2021 at 14:03