Skip to main content
added 289 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

CJam, 11 10 bytes

1 byte removed thanks to Erik the outgolfer

ri),{W#+}* 

This uses 1-based indexing.

Try it online!

Explanation

ri e# Read integer, n ) e# Increment by 1: gives n+1 , e# Range: gives [0 1 2 ... n] { }* e# Fold this block over the array W# e# Inverse of a number + e# Add two numbers 

CJam, 11 10 bytes

1 byte removed thanks to Erik the outgolfer

ri),{W#+}* 

This uses 1-based indexing.

Try it online!

CJam, 11 10 bytes

1 byte removed thanks to Erik the outgolfer

ri),{W#+}* 

This uses 1-based indexing.

Try it online!

Explanation

ri e# Read integer, n ) e# Increment by 1: gives n+1 , e# Range: gives [0 1 2 ... n] { }* e# Fold this block over the array W# e# Inverse of a number + e# Add two numbers 
added 57 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

CJam, 1111 10 bytes

1 byte removed thanks to Erik the outgolfer

ri),{-1#+W#+}* 

This uses 1-based indexing.

Try it online!Try it online!

CJam, 11 bytes

ri),{-1#+}* 

This uses 1-based indexing.

Try it online!

CJam, 11 10 bytes

1 byte removed thanks to Erik the outgolfer

ri),{W#+}* 

This uses 1-based indexing.

Try it online!

Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

CJam, 11 bytes

ri),{-1#+}* 

This uses 1-based indexing.

Try it online!