Skip to main content
3 of 4
added 73 characters in body
qwr
  • 12.3k
  • 6
  • 48
  • 80

C gnu99, 126 116 bytes

Port of my R answer. The initialization of array C to 1s is a GNU extension.

-10 bytes by rearranging loop logic printing leading 2, inspired by pajonk, and some small optimizations.

i=500,d=2,j,t,C[]={[0 ...255]=1};main(){while(i--){putchar(d+48);d=0;j=254;while(j-->2)t=10*C[j]+d,d=t/j,C[j]=t%j;}}

Attempt This Online!

qwr
  • 12.3k
  • 6
  • 48
  • 80