#Brainfuck, 24 Bytes.
Brainfuck, 24 Bytes.
I/O is handled as bytes.
,[[->+>+<<]>[-<+>]<-]>>.
Explained
,[[->+>+<<]>[-<+>]<-]>>.
, # Read a byte from STDIN
[ ] # Main loop, counting down all values from n to 1
[->+>+<<] # Copy the i value to *i+1 and *i+2
>[-<+>] # Move *i+1 back to i
<- # Move back to i, lower it by one. Because *i+2 is never reset, each iteration adds the value of i to it.
>>. # Output the value of *i+2
#Brainfuck, 24 Bytes.
I/O is handled as bytes.
,[[->+>+<<]>[-<+>]<-]>>.
Explained
,[[->+>+<<]>[-<+>]<-]>>.
, # Read a byte from STDIN
[ ] # Main loop, counting down all values from n to 1
[->+>+<<] # Copy the i value to *i+1 and *i+2
>[-<+>] # Move *i+1 back to i
<- # Move back to i, lower it by one. Because *i+2 is never reset, each iteration adds the value of i to it.
>>. # Output the value of *i+2
Brainfuck, 24 Bytes.
I/O is handled as bytes.
,[[->+>+<<]>[-<+>]<-]>>.
Explained
,[[->+>+<<]>[-<+>]<-]>>.
, # Read a byte from STDIN
[ ] # Main loop, counting down all values from n to 1
[->+>+<<] # Copy the i value to *i+1 and *i+2
>[-<+>] # Move *i+1 back to i
<- # Move back to i, lower it by one. Because *i+2 is never reset, each iteration adds the value of i to it.
>>. # Output the value of *i+2
#Brainfuck, 24 Bytes.
I/O is handled as bytes.
,[[->+>+<<]>[-<+>]<-]>>.
Explained
,[[->+>+<<]>[-<+>]<-]>>.
, # Read a byte from STDIN
[ ] # Main loop, counting down all values from n to 1
[->+>+<<] # Copy the i value to *i+1 and *i+2
>[-<+>] # Move *i+1 back to i
<- # Move back to i, lower it by one. Because *i+2 is never reset, each iteration adds the value of i to it.
>>. # Output the value of *i+2