login
A068109
a(1) = 0, a(2) = 1, a(n) = concatenate(a(n-1) and a(n-2)) - a(n-1).
2
0, 1, 9, 82, 747, 74035, 73961712, 7396097312323, 739609723836276649389, 7396097238362026884173559820662934, 7396097238362026884166163723424572712725550276455986455
OFFSET
1,3
LINKS
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
Sequence in context: A361715 A099371 A334611 * A163460 A081191 A060531
KEYWORD
nonn,base,easy
AUTHOR
Benoit Cloitre, Mar 21 2002
STATUS
approved