Skip to main content
added 131 characters in body
Source Link
Leaky Nun
  • 50.6k
  • 6
  • 115
  • 291

Cheddar, 26 bytes

Cheddar, 26 bytes

n g->n?g(n-=1)**2-g(n)+1:2 

Try it online!

Pretty idiomatic.

Explanation

n g -> // Input n, g is this function n ? // if n is > 1 g(n-=1)**2-g(n)+1 // Do equation specified in OEIS : 2 // if n == 0 return 2 

Cheddar, 26 bytes

n g->n?g(n-=1)**2-g(n)+1:2 

Pretty idiomatic.

Explanation

n g -> // Input n, g is this function n ? // if n is > 1 g(n-=1)**2-g(n)+1 // Do equation specified in OEIS : 2 // if n == 0 return 2 

Cheddar, 26 bytes

n g->n?g(n-=1)**2-g(n)+1:2 

Try it online!

Pretty idiomatic.

Explanation

n g -> // Input n, g is this function n ? // if n is > 1 g(n-=1)**2-g(n)+1 // Do equation specified in OEIS : 2 // if n == 0 return 2 
added 166 characters in body
Source Link
Downgoat
  • 29.2k
  • 6
  • 85
  • 157

Cheddar, 26 bytes

Cheddar, 26 bytes

n g->n?g(n-=1)**2-g(n)+1:2 

Try it online! Pretty idiomatic.

Cheddar is only three times longer than Jelly!

Explanation

n g -> // Input n, g is this function n ? // if n is > 1 g(n-=1)**2-g(n)+1 // Do equation specified in OEIS : 2 // if n == 0 return 2 

Cheddar, 26 bytes

n g->n?g(n-=1)**2-g(n)+1:2 

Try it online!

Cheddar is only three times longer than Jelly!

Cheddar, 26 bytes

n g->n?g(n-=1)**2-g(n)+1:2 

Pretty idiomatic.

Explanation

n g -> // Input n, g is this function n ? // if n is > 1 g(n-=1)**2-g(n)+1 // Do equation specified in OEIS : 2 // if n == 0 return 2 
added 131 characters in body
Source Link
Leaky Nun
  • 50.6k
  • 6
  • 115
  • 291

Cheddar, 26 bytes

Cheddar, 26 bytes

n g->n?g(n-=1)**2-g(n)+1:2 

Try it online!

Cheddar is only three times longer than Jelly!

Cheddar, 26 bytes

n g->n?g(n-=1)**2-g(n)+1:2 

Cheddar is only three times longer than Jelly!

Cheddar, 26 bytes

n g->n?g(n-=1)**2-g(n)+1:2 

Try it online!

Cheddar is only three times longer than Jelly!

Source Link
Downgoat
  • 29.2k
  • 6
  • 85
  • 157
Loading