Skip to main content
Correction
Source Link
runr
  • 261
  • 1
  • 4

R, 17 bytes

(n=scan())+-(-1)^n

where n=scan() takes the digit value.

R, 17 bytes

(n=scan())+(-1)^n

where n=scan() takes the digit value.

R, 17 bytes

(n=scan())-(-1)^n

where n=scan() takes the digit value.

Post Undeleted by runr
Post Deleted by runr
Post Undeleted by runr
Post Deleted by runr
Source Link
runr
  • 261
  • 1
  • 4

R, 17 bytes

(n=scan())+(-1)^n

where n=scan() takes the digit value.