Skip to main content
Commonmark migration
Source Link

#05AB1E, 4 bytes, Paul Picard, A001317

05AB1E, 4 bytes, Paul Picard, A001317

Code:

$Fx^ 

Try it online!

Explanation:

$ # Pushes 1 and input F # Pops x, creates a for-loop in range(0, x) x # Pops x, pushes x and 2x ^ # Bitwise XOR on the last two elements # Implicit, ends the for-loop # Implicit, nothing has printed so the last element is printed automatically 

The sequence basically is a binary Sierpinski triangle:

f(0)= 1 =1 f(1)= 1 1 =3 f(2)= 1 0 1 =5 f(3)= 1 1 1 1 =15 f(4)= 1 0 0 0 1 =17 

And translates to the formula a(n) = a(n - 1) XOR (2 × a(n - 1))

Luckily, I remembered this one :)

#05AB1E, 4 bytes, Paul Picard, A001317

Code:

$Fx^ 

Try it online!

Explanation:

$ # Pushes 1 and input F # Pops x, creates a for-loop in range(0, x) x # Pops x, pushes x and 2x ^ # Bitwise XOR on the last two elements # Implicit, ends the for-loop # Implicit, nothing has printed so the last element is printed automatically 

The sequence basically is a binary Sierpinski triangle:

f(0)= 1 =1 f(1)= 1 1 =3 f(2)= 1 0 1 =5 f(3)= 1 1 1 1 =15 f(4)= 1 0 0 0 1 =17 

And translates to the formula a(n) = a(n - 1) XOR (2 × a(n - 1))

Luckily, I remembered this one :)

05AB1E, 4 bytes, Paul Picard, A001317

Code:

$Fx^ 

Try it online!

Explanation:

$ # Pushes 1 and input F # Pops x, creates a for-loop in range(0, x) x # Pops x, pushes x and 2x ^ # Bitwise XOR on the last two elements # Implicit, ends the for-loop # Implicit, nothing has printed so the last element is printed automatically 

The sequence basically is a binary Sierpinski triangle:

f(0)= 1 =1 f(1)= 1 1 =3 f(2)= 1 0 1 =5 f(3)= 1 1 1 1 =15 f(4)= 1 0 0 0 1 =17 

And translates to the formula a(n) = a(n - 1) XOR (2 × a(n - 1))

Luckily, I remembered this one :)

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

#05AB1E, 4 bytes, Paul Picard4 bytes, Paul Picard, A001317

Code:

$Fx^ 

Try it online!

Explanation:

$ # Pushes 1 and input F # Pops x, creates a for-loop in range(0, x) x # Pops x, pushes x and 2x ^ # Bitwise XOR on the last two elements # Implicit, ends the for-loop # Implicit, nothing has printed so the last element is printed automatically 

The sequence basically is a binary Sierpinski triangle:

f(0)= 1 =1 f(1)= 1 1 =3 f(2)= 1 0 1 =5 f(3)= 1 1 1 1 =15 f(4)= 1 0 0 0 1 =17 

And translates to the formula a(n) = a(n - 1) XOR (2 × a(n - 1))

Luckily, I remembered this onethis one :)

#05AB1E, 4 bytes, Paul Picard, A001317

Code:

$Fx^ 

Try it online!

Explanation:

$ # Pushes 1 and input F # Pops x, creates a for-loop in range(0, x) x # Pops x, pushes x and 2x ^ # Bitwise XOR on the last two elements # Implicit, ends the for-loop # Implicit, nothing has printed so the last element is printed automatically 

The sequence basically is a binary Sierpinski triangle:

f(0)= 1 =1 f(1)= 1 1 =3 f(2)= 1 0 1 =5 f(3)= 1 1 1 1 =15 f(4)= 1 0 0 0 1 =17 

And translates to the formula a(n) = a(n - 1) XOR (2 × a(n - 1))

Luckily, I remembered this one :)

#05AB1E, 4 bytes, Paul Picard, A001317

Code:

$Fx^ 

Try it online!

Explanation:

$ # Pushes 1 and input F # Pops x, creates a for-loop in range(0, x) x # Pops x, pushes x and 2x ^ # Bitwise XOR on the last two elements # Implicit, ends the for-loop # Implicit, nothing has printed so the last element is printed automatically 

The sequence basically is a binary Sierpinski triangle:

f(0)= 1 =1 f(1)= 1 1 =3 f(2)= 1 0 1 =5 f(3)= 1 1 1 1 =15 f(4)= 1 0 0 0 1 =17 

And translates to the formula a(n) = a(n - 1) XOR (2 × a(n - 1))

Luckily, I remembered this one :)

added 2 characters in body
Source Link
Adnan
  • 44.7k
  • 6
  • 83
  • 248

#05AB1E, 4 bytes, Paul Picard, A001317

Code:

$Fx^ 

Try it online!

Explanation:

$ # Pushes 1 and input F # Pops x, creates a for-loop in range(0, x) x # Pops x, pushes x and 2x ^ # Bitwise XOR on the last two elements # Implicit, ends the for-loop # Implicit, nothing has printed so the last element is printed automatically 

The sequence basically is a binary Sierpinski triangle:

f(0)= 1 =1 f(1)= 1 1 =3 f(2)= 1 0 1 =5 f(3)= 1 1 1 1 =15 f(4)= 1 0 0 0 1 =17 

And translates to the formula a(n) = a(n - 1) ^XOR (2 × a(n - 1))

Luckily, I remembered this one :)

#05AB1E, 4 bytes, Paul Picard, A001317

Code:

$Fx^ 

Try it online!

Explanation:

$ # Pushes 1 and input F # Pops x, creates a for-loop in range(0, x) x # Pops x, pushes x and 2x ^ # Bitwise XOR on the last two elements # Implicit, ends the for-loop # Implicit, nothing has printed so the last element is printed automatically 

The sequence basically is a binary Sierpinski triangle:

f(0)= 1 =1 f(1)= 1 1 =3 f(2)= 1 0 1 =5 f(3)= 1 1 1 1 =15 f(4)= 1 0 0 0 1 =17 

And translates to the formula a(n) = a(n - 1) ^ (2 × a(n - 1))

Luckily, I remembered this one :)

#05AB1E, 4 bytes, Paul Picard, A001317

Code:

$Fx^ 

Try it online!

Explanation:

$ # Pushes 1 and input F # Pops x, creates a for-loop in range(0, x) x # Pops x, pushes x and 2x ^ # Bitwise XOR on the last two elements # Implicit, ends the for-loop # Implicit, nothing has printed so the last element is printed automatically 

The sequence basically is a binary Sierpinski triangle:

f(0)= 1 =1 f(1)= 1 1 =3 f(2)= 1 0 1 =5 f(3)= 1 1 1 1 =15 f(4)= 1 0 0 0 1 =17 

And translates to the formula a(n) = a(n - 1) XOR (2 × a(n - 1))

Luckily, I remembered this one :)

Source Link
Adnan
  • 44.7k
  • 6
  • 83
  • 248
Loading