Skip to main content
deleted 5 characters in body
Source Link
Dennis
  • 211.7k
  • 41
  • 380
  • 830

Jelly, 7 5 bytes

»‘µ*Ḃ 

Try it online!

Try it doubled!

Try it tripled!

How it works

»‘µ*Ḃ Main link. No arguments. Implicit argument: x = 0 ‘ Increment; yield x + 1 = 1. » Take the maximum of x and 1. Yields 1. µ Begin a new, monadic chain. Argument: y = 1 Ḃ Bit; yield 1 if y is odd, 0 if it is even. Yields 1. * Power; yield y**1 = 1. 
»‘µ*Ḃ»‘µ*Ḃ Main link. »‘µ*Ḃ As before. ‘ Increment; yield y + 1 = 2. » Take the maximum of 1 and 2. Yields 2. µ Begin a new, monadic chain. Argument: z = 2 Ḃ Bit; yield 1 if z is odd, 0 if it is even. Yields 0. * Power; yield z**0 = 1. 
»‘µ*Ḃ»‘µ*Ḃ»‘µ*Ḃ Main link. »‘µ*Ḃ»‘µ*Ḃ As before. ‘ Increment; yield z + 1 = 3. » Take the maximum of 1 and 3. Yields 3. µ Begin a new, monadic chain. Argument: w = 3 Ḃ Bit; yield 1 if w is odd, 0 if it is even. Yields 1. * Power; yield w**1 = 3. 

Jelly, 7 5 bytes

»‘µ*Ḃ 

Try it online!

Try it doubled!

Try it tripled!

How it works

»‘µ*Ḃ Main link. No arguments. Implicit argument: x = 0 ‘ Increment; yield x + 1 = 1. » Take the maximum of x and 1. Yields 1. µ Begin a new, monadic chain. Argument: y = 1 Ḃ Bit; yield 1 if y is odd, 0 if it is even. Yields 1. * Power; yield y**1 = 1. 
»‘µ*Ḃ»‘µ*Ḃ Main link. »‘µ*Ḃ As before. ‘ Increment; yield y + 1 = 2. » Take the maximum of 1 and 2. Yields 2. µ Begin a new, monadic chain. Argument: z = 2 Ḃ Bit; yield 1 if z is odd, 0 if it is even. Yields 0. * Power; yield z**0 = 1. 
»‘µ*Ḃ»‘µ*Ḃ»‘µ*Ḃ Main link. »‘µ*Ḃ»‘µ*Ḃ As before. ‘ Increment; yield z + 1 = 3. » Take the maximum of 1 and 3. Yields 3. µ Begin a new, monadic chain. Argument: w = 3 Ḃ Bit; yield 1 if w is odd, 0 if it is even. Yields 1. * Power; yield w**1 = 3. 
deleted 5 characters in body
Source Link
Dennis
  • 211.7k
  • 41
  • 380
  • 830
Source Link
Dennis
  • 211.7k
  • 41
  • 380
  • 830