Skip to main content
Commonmark migration
Source Link

#Ruby, 122 77 65 bytes

Ruby, 122 77 65 bytes

Thanks to Sherlock for shaving off 10 bytes.

require'prime'
->n{Prime.take(n).map{|x|1-2r/(x*x+1)}.reduce(:*)}

Defines an anonymous function that takes a number and returns a Rational.

#Ruby, 122 77 65 bytes

Thanks to Sherlock for shaving off 10 bytes.

require'prime'
->n{Prime.take(n).map{|x|1-2r/(x*x+1)}.reduce(:*)}

Defines an anonymous function that takes a number and returns a Rational.

Ruby, 122 77 65 bytes

Thanks to Sherlock for shaving off 10 bytes.

require'prime'
->n{Prime.take(n).map{|x|1-2r/(x*x+1)}.reduce(:*)}

Defines an anonymous function that takes a number and returns a Rational.

deleted 39 characters in body
Source Link
a spaghetto
  • 11.3k
  • 3
  • 46
  • 82

#Ruby, 122 77 6765 bytes

Thanks to Sherlock for shaving off 10 bytes.

require'prime'
->n{p Prime.take(n).map{|x|1-2r/(x*x+1)}.reduce(:*)}

Defines an anonymous function that takes a number and outputs the result to STDOUT asreturns a (numerator/denominator)Rational.

#Ruby, 122 77 67 bytes

Thanks to Sherlock for shaving off 10 bytes.

require'prime'
->n{p Prime.take(n).map{|x|1-2r/(x*x+1)}.reduce(:*)}

Defines an anonymous function that takes a number and outputs the result to STDOUT as (numerator/denominator).

#Ruby, 122 77 65 bytes

Thanks to Sherlock for shaving off 10 bytes.

require'prime'
->n{Prime.take(n).map{|x|1-2r/(x*x+1)}.reduce(:*)}

Defines an anonymous function that takes a number and returns a Rational.

added 50 characters in body
Source Link
a spaghetto
  • 11.3k
  • 3
  • 46
  • 82

#Ruby, 122 77 67 bytes

Thanks to Sherlock for shaving off 10 bytes.

require'prime'
->n{p Prime.take(n).map{|x|1-2r/(x*x+1)}.reduce(:*)}

Defines an anonymous function that takes a number and outputs the result to STDOUT as (numerator/denominator).

#Ruby, 122 77 67 bytes

require'prime'
->n{p Prime.take(n).map{|x|1-2r/(x*x+1)}.reduce(:*)}

Defines an anonymous function that takes a number and outputs the result to STDOUT as (numerator/denominator).

#Ruby, 122 77 67 bytes

Thanks to Sherlock for shaving off 10 bytes.

require'prime'
->n{p Prime.take(n).map{|x|1-2r/(x*x+1)}.reduce(:*)}

Defines an anonymous function that takes a number and outputs the result to STDOUT as (numerator/denominator).

edited body
Source Link
a spaghetto
  • 11.3k
  • 3
  • 46
  • 82
Loading
deleted 3 characters in body
Source Link
a spaghetto
  • 11.3k
  • 3
  • 46
  • 82
Loading
deleted 32 characters in body
Source Link
a spaghetto
  • 11.3k
  • 3
  • 46
  • 82
Loading
Source Link
a spaghetto
  • 11.3k
  • 3
  • 46
  • 82
Loading