OFFSET
1,3
LINKS
Stefano Spezia, Table of n, a(n) for n = 1..17
EXAMPLE
a(5) = 82|9 - 82 = 747.
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Benoit Cloitre, Mar 21 2002
STATUS
approved