cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A077623 a(1)=1, a(2)=2, a(3)=4, a(n) = abs(a(n-1) - a(n-2) - a(n-3)).

Original entry on oeis.org

1, 2, 4, 1, 5, 0, 6, 1, 5, 2, 4, 3, 3, 4, 2, 5, 1, 6, 0, 7, 1, 6, 2, 5, 3, 4, 4, 3, 5, 2, 6, 1, 7, 0, 8, 1, 7, 2, 6, 3, 5, 4, 4, 5, 3, 6, 2, 7, 1, 8, 0, 9, 1, 8, 2, 7, 3, 6, 4, 5, 5, 4, 6, 3, 7, 2, 8, 1, 9, 0, 10, 1, 9, 2, 8, 3, 7, 4, 6, 5, 5, 6, 4, 7, 3, 8, 2, 9, 1, 10, 0, 11, 1, 10, 2, 9, 3, 8, 4, 7, 5, 6, 6
Offset: 1

Views

Author

Benoit Cloitre, Dec 02 2002

Keywords

Crossrefs

Programs

  • 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
    
  • 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 *)
  • 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

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