editing
approved
editing
approved
# second Maple program:
a:= proc(n) option remember; `if`(n=0, 1, a(n-1)+
`if`((t-> issqr(t+4) or issqr(t-4))(5*n^2), 1, 0)-
`if`((t-> is(2^ilog2(t)=t))(n-1), 1, 0))
end:
seq(a(n), n=1..120); # Alois P. Heinz, Aug 14 2021
approved
editing
editing
approved
editing
approved
Wikipedia, <a href="httphttps://en.wikipedia.org/wiki/AVL_tree">AVL tree</a>
approved
editing
proposed
approved
editing
proposed
a[n_] := Module[{j, p}, For[j = Log[(1+Sqrt[5])/2, n] // Floor, Fibonacci[j+1] <= n, j++]; p = Log[2, n] // Floor; j-p-If[2^p < n, 2, 1]]; Table[a[n], {n, 1, 120}] (* Jean-François Alcover, Dec 30 2013, translated from Maple *)
approved
editing
editing
approved