OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
a(n)/sqrt(n) is bounded. More precisely, let M(n) = Max ( a(k) : 1<=k<=n ); then M(n) = floor(sqrt(n+29)) for n>=4
MATHEMATICA
a[n_]:= a[n]= If[n<4, 2^(n-1), Abs[a[n-1] -a[n-2] -a[n-3]]];
Table[a[n], {n, 120}] (* G. C. Greubel, Sep 11 2024 *)
PROG
(Haskell)
a077623 n = a077623_list !! (n-1)
a077623_list = 1 : 2 : 4 : zipWith3 (\u v w -> abs (w - v - u))
a077623_list (tail a077623_list) (drop 2 a077623_list)
-- Reinhard Zumkeller, Oct 11 2014
(Magma)
m:=120;
A077623:=[n le 3 select 2^(n-1) else Abs(Self(n-1) - Self(n-2) - Self(n-3)): n in [1..m+5]];
[A077623[n]: n in [1..m]]; // G. C. Greubel, Sep 11 2024
(SageMath)
@CachedFunction
def a(n): # a = A077623
if n<4: return 2^(n-1)
else: return abs(a(n-1)-a(n-2)-a(n-3))
[a(n) for n in range(1, 121)] # G. C. Greubel, Sep 11 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Dec 02 2002
STATUS
approved