OFFSET
0,5
COMMENTS
MAPLE
read("transforms") ;
A102111 := proc(n)
option remember;
if n <= 2 then
return op(n+1, [0, 0, 1]) ;
else
return procname(n-1)+procname(n-2)+digrev(procname(n-3)) ;
end if;
end proc:
seq(A102111(n), n=0..20) ; # R. J. Mathar, Nov 17 2012
MATHEMATICA
R[n_]:=FromDigits[Reverse[IntegerDigits[n]]]; Clear[a]; a[0]=0; a[1]=0; a[2]=1; a [n_]:=a[n]=a[n-1]+a[n-2]+R[a[n-3]]; Table[a[n], {n, 0, 40}]
nxt[{a_, b_, c_}]:={b, c, IntegerReverse[a]+b+c}; NestList[nxt, {0, 0, 1}, 40][[;; , 1]] (* Harvey P. Dale, Jul 18 2023 *)
PROG
(Python)
def R(n):
n_str = str(n)
reversedn_str = n_str[::-1]
reversedn = int(reversedn_str)
return reversedn
def A(n):
if n == 0:
return 0
elif n == 1:
return 0
elif n == 2:
return 1
elif n >= 3:
return A(n-1)+A(n-2)+R(A(n-3))
for i in range(0, 20):
print(A(i)) # Dylan Delgado, Oct 23 2019
(Magma) a:=[0, 0, 1]; [n le 3 select a[n] else Self(n-1) + Self(n-2) + Seqint(Reverse(Intseq(Self(n-3)))):n in [1..36]]; // Marius A. Burtea, Oct 23 2019
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Jonathan Vos Post and Ray Chandler, Dec 30 2004
STATUS
approved