Skip to main content
Commonmark migration
Source Link

#Japt, 16 bytes

Japt, 16 bytes

Even Mathematica is shorter. :-/

U*2ª1 o àU l /°U

Try it online!

###Ungolfed and explanation

Ungolfed and explanation

U*2ª 1 o àU l /° U
U*2||1 o àU l /++U

         // Implicit: U = input number
U*2||1   // Take U*2. If it is zero, take 1.
o àU     // Generate a range of this length, and calculate all combinations of length U.
l /++U   // Take the length of the result and divide by (U+1).
         // Implicit: output result

Alternate version, based on the recursive formula:

C=_?(4+6/~Z *C$(Z-1):1};$C(U

#Japt, 16 bytes

Even Mathematica is shorter. :-/

U*2ª1 o àU l /°U

Try it online!

###Ungolfed and explanation

U*2ª 1 o àU l /° U
U*2||1 o àU l /++U

         // Implicit: U = input number
U*2||1   // Take U*2. If it is zero, take 1.
o àU     // Generate a range of this length, and calculate all combinations of length U.
l /++U   // Take the length of the result and divide by (U+1).
         // Implicit: output result

Alternate version, based on the recursive formula:

C=_?(4+6/~Z *C$(Z-1):1};$C(U

Japt, 16 bytes

Even Mathematica is shorter. :-/

U*2ª1 o àU l /°U

Try it online!

Ungolfed and explanation

U*2ª 1 o àU l /° U
U*2||1 o àU l /++U

         // Implicit: U = input number
U*2||1   // Take U*2. If it is zero, take 1.
o àU     // Generate a range of this length, and calculate all combinations of length U.
l /++U   // Take the length of the result and divide by (U+1).
         // Implicit: output result

Alternate version, based on the recursive formula:

C=_?(4+6/~Z *C$(Z-1):1};$C(U
added 90 characters in body
Source Link
ETHproductions
  • 50.1k
  • 6
  • 94
  • 240

#Japt, 16 bytes

Even Mathematica is shorter. :-/

U*2ª1 o àU l /°U

Try it online!

###Ungolfed and explanation

U*2ª 1 o àU l /° U
U*2||1 o àU l /++U

         // Implicit: U = input number
U*2||1   // Take U*2. If it is zero, take 1.
o àU     // Generate a range of this length, and calculate all combinations of length U.
l /++U   // Take the length of the result and divide by (U+1).
         // Implicit: output result

Alternate version, based on the recursive formula:

C=_?(4+6/~Z *C$(Z-1):1};$C(U

#Japt, 16 bytes

Even Mathematica is shorter. :-/

U*2ª1 o àU l /°U

Try it online!

###Ungolfed and explanation

U*2ª 1 o àU l /° U
U*2||1 o àU l /++U

         // Implicit: U = input number
U*2||1   // Take U*2. If it is zero, take 1.
o àU     // Generate a range of this length, and calculate all combinations of length U.
l /++U   // Take the length of the result and divide by (U+1).
         // Implicit: output result

#Japt, 16 bytes

Even Mathematica is shorter. :-/

U*2ª1 o àU l /°U

Try it online!

###Ungolfed and explanation

U*2ª 1 o àU l /° U
U*2||1 o àU l /++U

         // Implicit: U = input number
U*2||1   // Take U*2. If it is zero, take 1.
o àU     // Generate a range of this length, and calculate all combinations of length U.
l /++U   // Take the length of the result and divide by (U+1).
         // Implicit: output result

Alternate version, based on the recursive formula:

C=_?(4+6/~Z *C$(Z-1):1};$C(U
added 380 characters in body
Source Link
ETHproductions
  • 50.1k
  • 6
  • 94
  • 240

#Japt, 16 bytes

Even Mathematica is shorter. :-/

U*2ª1 o àU l /°U

Try it online!

###Ungolfed and explanation

U*2ª 1 o àU l /° U
U*2||1 o àU l /++U

         // Implicit: U = input number
U*2||1   // Take U*2. If it is zero, take 1.
o àU     // Generate a range of this length, and calculate all combinations of length U.
l /++U   // Take the length of the result and divide by (U+1).
         // Implicit: output result

#Japt, 16 bytes

Even Mathematica is shorter. :-/

U*2ª1 o àU l /°U

Try it online!

#Japt, 16 bytes

Even Mathematica is shorter. :-/

U*2ª1 o àU l /°U

Try it online!

###Ungolfed and explanation

U*2ª 1 o àU l /° U
U*2||1 o àU l /++U

         // Implicit: U = input number
U*2||1   // Take U*2. If it is zero, take 1.
o àU     // Generate a range of this length, and calculate all combinations of length U.
l /++U   // Take the length of the result and divide by (U+1).
         // Implicit: output result
Source Link
ETHproductions
  • 50.1k
  • 6
  • 94
  • 240
Loading