Skip to main content
deleted 4 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Python 3.8+,  45  39 bytes

-2 thanks to xnor (while print(...)!=0:while[print(...)]:)
-4 thanks to Neil ([a*n,a//n][a>n]a//n or a*n)

a=n=1
while[print(a:=a//n or a*n)]:n+=1

A full program which prints \$a(n)\$ for all natural numbers.

Try it online!


As a recursive function, 5349:

f=lambda v,n=1,a=1:a*(v<n)or f(v,n+1,[a*n,a//n][a>n]n or a*n)

Python 3.8+,  45  39 bytes

-2 thanks to xnor (while print(...)!=0:while[print(...)]:)
-4 thanks to Neil ([a*n,a//n][a>n]a//n or a*n)

a=n=1
while[print(a:=a//n or a*n)]:n+=1

A full program which prints \$a(n)\$ for all natural numbers.

Try it online!


As a recursive function, 53:

f=lambda v,n=1,a=1:a*(v<n)or f(v,n+1,[a*n,a//n][a>n])

Python 3.8+,  45  39 bytes

-2 thanks to xnor (while print(...)!=0:while[print(...)]:)
-4 thanks to Neil ([a*n,a//n][a>n]a//n or a*n)

a=n=1
while[print(a:=a//n or a*n)]:n+=1

A full program which prints \$a(n)\$ for all natural numbers.

Try it online!


As a recursive function, 49:

f=lambda v,n=1,a=1:a*(v<n)or f(v,n+1,a//n or a*n)
added 225 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Python 3.8+, 45 45  39 bytes

-2 thanks to xnor (while print(...)!=0:while[print(...)]:)
-4 thanks to Neil ([a*n,a//n][a>n]a//n or a*n)

a=n=1
while printwhile[print(a:=[a*n,a=a//n][a>n]n or a*n)!=0]:n+=1

A full program which prints \$a(n)\$ for all natural numbers.

Try it online!Try it online!


As a recursive function, 53:

f=lambda v,n=1,a=1:a*(v<n)or f(v,n+1,[a*n,a//n][a>n])

Python 3.8+, 45 bytes

a=n=1
while print(a:=[a*n,a//n][a>n])!=0:n+=1

A full program which prints \$a(n)\$ for all natural numbers.

Try it online!


As a recursive function, 53:

f=lambda v,n=1,a=1:a*(v<n)or f(v,n+1,[a*n,a//n][a>n])

Python 3.8+,  45  39 bytes

-2 thanks to xnor (while print(...)!=0:while[print(...)]:)
-4 thanks to Neil ([a*n,a//n][a>n]a//n or a*n)

a=n=1
while[print(a:=a//n or a*n)]:n+=1

A full program which prints \$a(n)\$ for all natural numbers.

Try it online!


As a recursive function, 53:

f=lambda v,n=1,a=1:a*(v<n)or f(v,n+1,[a*n,a//n][a>n])
added 98 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Python 3.8+, 45 bytes

a=n=1
while print(a:=[a*n,a//n][a>n])!=0:n+=1

A full program which prints \$a(n)\$ for all natural numbers.

Try it online!


As a recursive function, 53:

f=lambda v,n=1,a=1:a*(v<n)or f(v,n+1,[a*n,a//n][a>n])

Python 3.8+, 45 bytes

a=n=1
while print(a:=[a*n,a//n][a>n])!=0:n+=1

A full program which prints \$a(n)\$ for all natural numbers.

Try it online!

Python 3.8+, 45 bytes

a=n=1
while print(a:=[a*n,a//n][a>n])!=0:n+=1

A full program which prints \$a(n)\$ for all natural numbers.

Try it online!


As a recursive function, 53:

f=lambda v,n=1,a=1:a*(v<n)or f(v,n+1,[a*n,a//n][a>n])
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading