OFFSET
1,3
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
For n >= 5, a(n^2 + 24*n - 13) = 0.
For n >= 38, Max( a(k) : 1<=k<=n) = floor(sqrt(n+156)).
MATHEMATICA
a[n_]:= a[n]= If[n<4, 6^Floor[(n-1)/2], Abs[a[n-1] -a[n-2] -a[n-3]]];
Table[a[n], {n, 100}] (* G. C. Greubel, Sep 11 2024 *)
PROG
(Haskell)
a079624 n = a079624_list !! (n-1)
a079624_list = 1 : 1 : 6 : zipWith3 (\u v w -> abs (w - v - u))
a079624_list (tail a079624_list) (drop 2 a079624_list)
-- Reinhard Zumkeller, Oct 11 2014
(Magma)
m:=120;
A079624:=[n le 3 select 6^Floor((n-1)/2) else Abs(Self(n-1) - Self(n-2) - Self(n-3)): n in [1..m+5]];
[A079624[n]: n in [1..m]]; // G. C. Greubel, Sep 11 2024
(SageMath)
@CachedFunction
def a(n): # a = A079624
if n<4: return 6^((n-1)//2)
else: return abs(a(n-1)-a(n-2)-a(n-3))
[a(n) for n in range(1, 101)] # G. C. Greubel, Sep 11 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Jan 30 2003
STATUS
approved