Skip to main content
deleted 3 characters in body
Source Link
Robert S.
  • 1.3k
  • 11
  • 17

R, 25 2323 21 bytes

-2 bytes thanks to Jo King

functionn=scan(n)n;n-2+(n+2)%%5

Try it online!Try it online!

Outputs nth element in sequence.

R, 25 23 bytes

-2 bytes thanks to Jo King

function(n)n-2+(n+2)%%5

Try it online!

Outputs nth element in sequence.

R, 25 23 21 bytes

-2 bytes thanks to Jo King

n=scan();n-2+(n+2)%%5

Try it online!

Outputs nth element in sequence.

added 36 characters in body
Source Link
Robert S.
  • 1.3k
  • 11
  • 17

R, 2525 23 bytes

Outputs nth element in sequence.-2 bytes thanks to Jo King

function(n)n-2+((n+2)%%5)

Try it online!Try it online!

Outputs nth element in sequence.

R, 25 bytes

Outputs nth element in sequence.

function(n)n-2+((n+2)%%5)

Try it online!

R, 25 23 bytes

-2 bytes thanks to Jo King

function(n)n-2+(n+2)%%5

Try it online!

Outputs nth element in sequence.

Source Link
Robert S.
  • 1.3k
  • 11
  • 17

R, 25 bytes

Outputs nth element in sequence.

function(n)n-2+((n+2)%%5)

Try it online!