[Question]
  [
Write a program or named function that will output or return the sequence up to the `n`th integer in the Iccanobif sequence, documented on OEIS as [A014258](https://oeis.org/A014258). Note that only the zeroth element in the sequence (`0`) will be printed if `n` is zero.
The sequence is generated by starting like the standard Fibonacci sequence, but after adding the two previous numbers, you flip the result and drop any leading zeros. An interesting fact, to me at least, is that this sequence is not strictly increasing (see the list below). It also seems to be (and probably is) strictly greater than or equal to the Fibonacci sequence.
Your program's input must be an integer.
The first 20 numbers of the sequence are provided here for your viewing pleasure:
```
0, 1, 1, 2, 3, 5, 8, 31, 93, 421, 415, 638, 3501, 9314, 51821, 53116, 739401, 715297, 8964541, 8389769
```
Standard loopholes are forbidden.
Shortest program wins.
EDIT: Added a note to clarify that the sequence starts with the zeroth element and should be included if `n` is zero.
### Example IO possibilities:
```
0    ->    0
1    ->    0 1
6    ->    0 1 1 2 3 5 8
17   ->    [0, 1, 1, 2, 3, 5, 8, 31, 93, 421, 415, 638, 3501, 9314, 51821, 53116, 739401, 715297]
```
Now that there are several answers, below are my implementations in Python 2 that I worked hard to hide with markup:
Iterative:
> 
> 
> ```
> #Closest to my initial program. 73 bytes. It should also be noted that this program
>  cannot reach a stack overflow. It runs for n=5000 in less than 10 seconds.
> 
> i,a,b=input(),0,1
> print a
> while i:print b;i,a,b=i-1,b,int(str(a+b)[::-1])
> ```
> 
> 
> 
> 
Recursive:
> 
> 
> ```
> #Note that this prints n trailing newlines. 64 bytes.
>  Will hit a stack overflow error for large values of n.
> 
> def f(n,i=0,j=1):print i,n and f(n-1,j,int(str(i+j)[::-1]))or'';
> ```
> 
> 
> 
> 
  
[Answer]
## Python 2, 58 bytes
```
a=0;b=1
exec"print a;a,b=b,int(str(a+b)[::-1]);"*-~input()
```
Uses `str` to convert rather than backticks because large enough numbers in Python 2 are written with an L at the end. I tried a recursive function, but it turned out longer (61):
```
f=lambda n,a=0,b=1:-~n*[0]and[a]+f(n-1,b,int(str(a+b)[::-1]))
```
[Answer]
# Pyth, ~~17~~ ~~15~~ 14
```
Pu+Gs_`s>2GQU2
```
[Try it online](https://pyth.herokuapp.com/?code=Pu%2BGs_%60s%3E2GQU2&input=17&debug=0)
Very basic implementation, starts with `range(2)` and adds a number of elements equal to the input, then ~~slices off the extras~~ pops off the last element.
Thanks @Jakube for pointing out the `>` reversal thingy.
### Explanation
```
Pu+Gs_`s>2GQU2    : Q = eval(input) (implicit)
P                 : all but the last element
 u         QU2    : reduce Q times starting with [0, 1]
  +G              : add to the previous result
       s>2G       : sum of the last two elements of G
    s_`           : int(reversed(repr(above value)))
```
[Answer]
# Julia, 79 bytes
```
f=n->(t=[0,1];for i=2:n push!(t,t[i]+t[i-1]|>string|>reverse|>int)end;t[1:n+1])
```
This creates a function that accepts an integer as input and returns an integer array.
Ungolfed + explanation:
```
function f(n)
    # Start with the usual Fibonacci stuff
    t = [0,1]
    # Looooooooooooooop
    for i = 2:n
        # Compute the Iccanobif number by piping results
        iccanobif = t[i] + t[i-1] |> string |> reverse |> int
        # Jam it into t
        push!(t, iccanobif)
    end
    # Return the first n + 1
    t[1:n+1]
end
```
Examples:
```
julia> f(1)
2-element Array{Int64,1}:
 0
 1
julia> f(17)
18-element Array{Int64,1}:
      0
      1
      1
      2
      3
      5
      8
     31
     93
    421
    415
    638
   3501
   9314
  51821
  53116
 739401
 715297
```
[Answer]
# T-SQL, 149
Very straight forward inline table function that uses a recursive CTE query. As it is using INTs this will top out at 37. Adding in CASTs for bigints will allow it to go further to 63
```
create function i(@ int)returns table return with r as(select 0I,1N union all select n,reverse(i+n)+0from r)select 0n union all select top(@)n from r
```
It is used as follows
```
select * from i(0)
n
-----------
0
(1 row(s) affected)
select * from i(1)
n
-----------
0
1
(2 row(s) affected)
select * from i(6)
n
-----------
0
1
1
2
3
5
8
(7 row(s) affected)
select * from i(17)
n
-----------
0
1
1
2
3
5
8
31
93
415
421
638
3501
9314
51821
53116
715297
739401
(18 row(s) affected)
```
[Answer]
# K, ~~25~~ 23 bytes
```
{-1_ x{x,.|$+/-2#x}/!2}
```
A simple modification of one of the examples at [No Stinking Loops](http://kx.com/a/k/examples/recur.k).
The phrase `.|$` casts a number to a string, reverses it and then evaluates it.
## Edit:
Sloppy attention to boundary conditions on my part. More correct now:
```
  {-1_ x{x,.|$+/-2#x}/!2}'0 1 6 10
(,0
 0 1
 0 1 1 2 3 5 8
 0 1 1 2 3 5 8 31 93 421 415)
```
## Edit 2:
`(x+1)#` can be replaced with `-1_`, saving 2 characters. The space is necessary because otherwise `_x` would be an identifier, when I want the "drop" operator applied to a variable called `x`.
[Answer]
# Haskell, ~~64~~ 49 bytes
```
a!b=a:b!(read$reverse$show$a+b)
q n=0:take n(1!1)
```
Usage example: `q 15` -> `[0,1,1,2,3,5,8,31,93,421,415,638,3501,9314,51821,53116]`
How it works: `!` recursively builds an infinite list of iccanobif numbers starting with it's first argument (the second argument must be the next iccanobif number). `q` takes the first `n` numbers from the iccanobif list starting with `1, 1` and prepends a `0`.
[Answer]
# CJam, 18 bytes
```
U1{_2$+sW%i}ri*;]p
```
**How it works**
```
U1                      e# First two numbers in the series
  {        }ri*         e# Run the loop input numbers times
   _2$+                 e# Get sum of last two numbers in the series
       sW%i             e# Convert to string, inverse and convert back to a number
                ;       e# Remove the last number to get only first n + 1 numbers.
                 ]p     e# Wrap all numbers in an array and print the array
```
[Try it online here](http://cjam.aditsu.net/#code=U1%7B_2%24%2BsW%25i%7Dri*%3B%5Dp&input=17)
[Answer]
# Java - ~~126~~ 124
I haven't seen Java around this site in awhile...
```
void f(int b){for(int c=0,d=1,g;b-->=0;d=Integer.valueOf(new StringBuilder(c+(c=d)+"").reverse()+""))System.out.println(c);}
```
`f(5)` prints `0 1 1 2 3 5 8 31 93 421 415 638`
[Answer]
# SWI-Prolog, ~~141~~ ~~131~~ 121 bytes
```
a(X,R):-X>1,A is X-1,a(A,B),reverse(B,[K,L|_]),W is K+L,name(W,Z),reverse(Z,Y),name(E,Y),nth0(X,R,E,B);X=1,R=[0,1];R=[0].
```
Running `a(17,X).` outputs:
```
[0, 1, 1, 2, 3, 5, 8, 31, 93, 421, 415, 638, 3501, 9314, 51821, 53116, 739401, 715297] 
```
Takes about 10 seconds to output the result of `a(10000,X).` on my computer.
Edit: The 121 bytes version above is a one predicate definition = one liner.
The old 131 bytes version is the following (must be runned as `p(17,X)`):
```
a(0,[0]).
a(1,[1,0]).
a(X,[E|B]):-A is X-1,a(A,B),B=[K,L|_],W is K+L,name(W,Z),reverse(Z,Y),name(E,Y).
p(X,Y):-a(X,Z),reverse(Z,Y).
```
[Answer]
## [><> (Fish)](http://esolangs.org/wiki/Fish) ~~592~~ 254 Bytes
Not super golfed (42/43 blanks that do nothing and a total of 30 redirection tokens) , but was an interesting exercise getting it working in the first place.
```
10!/{:}0=?v/{1-}}:{+:0}!/a,:1%-:0=?!v~{:1!/$:@0=?!v$~}}:&{{&*\
/-$/    ;n/\oo", "n:    \       }+1{/     \$-1$*a /|.!20}}01@/
* :{:}(?v:{!":}-1!/$:@0=?!v$~{:}1!/$:@0=?!v$~}}}:&{{{&*:1%-*&{{&+}}{1+}02.
b .1 +bb   \      \$-1$*a /       \$-1$,a /
\*9{~~~{/
```
You can test it [here](http://fishlanguage.com/playground/6rsxwkJHFgobme6gf), providing the desired length in the initial stack.
EDIT: More than halved byte count
[Answer]
# PHP, 114, 109 bytes
```
function f($n){if($n==0)return 0;$f=[0,1];for($i=2;$i<=$n;++$i){$f[$i]=strrev($f[$i-1]+$f[$i-2]);}return $f;}
```
Nothing fancy, just an average fibonacci algorithm with the string reverse magic.
Ungolfed:
```
function f($n)
{
    if($n == 0) return 0;
    $f = [0, 1];
    for ($i=2; $i<=$n; ++$i){
        $f[$i] = strrev($f[$i-1] + $f[$i-2]);
    }
    return $f;
}
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 10 bytes
```
↑¡ȯ↔Σ↑_2ŀ2
```
[Try it online!](https://tio.run/##yygtzv7//1HbxEMLT6x/1Dbl3GIgO97oaIPR////DS0A "Husk – Try It Online")
[Answer]
### Excel VBA, 279 bytes
```
n = InputBox("n")
For i = 0 To n
If i < 2 Then
Cells(i + 1, 1) = i
ElseIf i > 6 Then
x = Cells(i, 1) + Cells(i - 1, 1)
l = Len(x)
v = CStr(x)
For j = 1 To l
r = r + Right(v, 1)
v = Left(v, l - j)
Next j
Cells(i + 1, 1) = r
r = ""
Else
Cells(i + 1, 1) = Cells(i, 1) + Cells(i - 1, 1)
End If
Next i
```
Running the macro will prompt the user to enter a value for n.
The results will then be printed row by row in column A:
![Output](https://i.stack.imgur.com/K4ElQ.jpg)
[Answer]
# JavaScript (ES2015), ~~81~~ 73 bytes
```
(a,b=0,c=1)=>{for(;a-->-1;c=[...(b+(b=+c)+"")].reverse().join``)alert(b)}
```
Running this function (named `f`) with `6`:
```
f(6);// alerts: 0, 1, 1, 2, 3, 5, 8
```
[Answer]
# [Pip](https://github.com/dloscutoff/pip), 13 bytes
I'm pretty sure all the features used in this program were present in Pip before this question was asked.
```
LaSio:+RVi+oi
```
Takes input as command-line argument. [Try it online!](https://tio.run/nexus/pip#@@@TGJyZb6UdFJapnZ/5//9/SwA "Pip – TIO Nexus")
### Explanation
```
               a is 1st cmdline arg; i is 0; o is 1 (implicit)
La             Loop (a) times:
       RVi+o   Reverse of i+o
      +        Unary + treats its operand as a number, thus removing leading 0's
    o:         Assign the result to o...
  Si           ... before swapping i and o
            i  After the loop, output i
```
The two variables' values evolve like so:
```
Iter   o   i (output)
   0   1   0
   1   0   1
   2   1   1
   3   1   2
   4   2   3
   5   3   5
   6   5   8
   7   8  31
   8  31  93
   9  93 421
  10 421 415
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 bytes
```
+ṚḌɗÐ¡1
```
[Try it online!](https://tio.run/##ARkA5v9qZWxsef//K@G5muG4jMmXw5DCoTH//zEw "Jelly – Try It Online")
Reads `n` from STDIN
## How it works
```
+ṚḌɗÐ¡1 - Main link. No arguments
        - By default, set the left argument to 0
      1 - Set the right argument to 0
    Ð¡  - Read n from STDIN and do the following n times:
          Start with x = 0, y = 1, then update according to
          x, y = y, f(x,y), collecting each intermediate step
   ɗ    - Define f(x, y):
+       -   x + y
 Ṛ      -   Reversed digits
  Ḍ     -   Back to integer
```
[Answer]
# [R](https://www.r-project.org/), 87 bytes
```
function(n)while(n+1){n=n-1;show(+F);F=T+(T=F);F=F%/%10^(z=0:log10(F))%%10%*%10^rev(z)}
```
[Try it online!](https://tio.run/##Rc05CoAwEEDR0wRmDGKmVabNCawFDS4BmYArKJ49Lo3d5zV/it65WkLjO47dKm7xQUBwH/zYgmjCU1hSKuYh7KAtFpZLDSV/ZVWmyFRwsMnH0JMBi6geUsnrU7vBgde/ACKMNw "R – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `W`, ~~10~~ 9 bytes
```
01?(~+Ṙ)_
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJXIiwiIiwiMDE/KH4r4bmYKV8iLCIiLCIxNyJd)
-1 thanks to Steffan
Similar to the [CJam](https://codegolf.stackexchange.com/a/52092/107299) answer.
```
01?(~+Ṙ)_ # 'W' flag prints the entire stack
01        # Push 0, then 1
  ?(   )  # Loop input number of times
    ~+    # Add the previous 2 numbers without popping
      Ṙ   # Reverse the result (given a number, the output will be a number)
        _ # Pop the last result
```
[Answer]
# [Pushy](https://github.com/FTcode/Pushy), 18 bytes (non-competing)
```
Z1{:2d+vFs@KjkvF;_
```
**[Try it online!](https://tio.run/nexus/pushy#@x9lWG1llKJd5lbs4J2VXeZmHf///38jAwMA "Pushy – TIO Nexus")**
It's not the most elegant of programs, but it works.
```
Z1     \ Push 0 and 1 to begin the sequence
{:     \ Input times do:
 2d+   \   Add the last two terms
 vF    \   Send to second stack
 s     \   Split into digits
 @Kjk  \   Reverse and join into one number
 vF;    \   Send back to first stack
_      \ At the end of the program, print the whole stack.
```
[Answer]
# R, 134 bytes
```
i=function(n){s=c(0,1);for(i in 3:n){s[i]=as.numeric(paste0(rev(strsplit(as.character(s[i-2]+s[i-1]),'')[[1]]),collapse=''))};cat(s)}
```
Example:
```
> i(10)
0 1 1 2 3 5 8 31 93 421
```
Would love to see if somebody had a better R alternative than to take your number, make it a string, reverse it and turn it back into a number again.
[Answer]
# Groovy, 70 bytes
```
{r={"$it".reverse() as int};f={n->n<3?1:r(f(n-1))+r(f(n-2))};r(f(it))}
```
---
```
{
    r={"$it".reverse() as int};       // Reverse digits, costly using string.
    f={n->n<3?1:r(f(n-1))+r(f(n-2))}; // Recursive Iccanobbif implementation.
    r(f(it))                          // Reverse final output.
}
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 10 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Outputs the `n`th element, 0-indexed.
```
@Zä+ Ìsw}g
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QFrkKyDMc3d9Zw&input=MTc)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 9 bytes
```
0+ṚV$¥Ð¡1
```
[Try it online!](https://tio.run/##y0rNyan8/99A@@HOWWEqh5YennBooeH///8NzQE "Jelly – Try It Online")
]