A068109 a(1) = 0, a(2) = 1, a(n) = concatenate(a(n-1) and a(n-2)) - a(n-1).
0, 1, 9, 82, 747, 74035, 73961712, 7396097312323, 739609723836276649389, 7396097238362026884173559820662934, 7396097238362026884166163723424572712725550276455986455
Offset: 1
Examples
a(5) = 82|9 - 82 = 747.
Links
- Stefano Spezia, Table of n, a(n) for n = 1..17
Programs
-
Maple
a:= proc(n) option remember; `if`(n<3, n-1, (l-> add(l[i]*10^(i-1), i=1..nops(l))-a(n-1))(map( x-> convert(x, base, 10)[], [a(n-2),a(n-1)]))) end: seq(a(n), n=1..12); # Alois P. Heinz, Jun 09 2021
-
Mathematica
a[1]=0; a[2]=1; a[n_]:=FromDigits[Join[IntegerDigits[a[n-1]],IntegerDigits[a[n-2]]]]-a[n-1]; Array[a,12] (* Stefano Spezia, Apr 25 2023 *)
-
Python
def f(v): return int((str(v[-1])+str(v[-2]))) - v[-1] def aupton(nn): alst = [0, 1] for n in range(2, nn+1): alst.append(f(alst)) return alst[:nn+1] print(aupton(10)) # Michael S. Branicky, Jun 09 2021