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.

A226222 a(1) = a(2) = a(3) = 1, a(n) = a(n-2-a(n-2)) + a(n-1-a(n-3)) for n>3.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 3, 4, 5, 5, 5, 6, 6, 7, 7, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 13, 13, 13, 14, 15, 16, 16, 16, 17, 18, 18, 18, 18, 19, 20, 21, 21, 21, 21, 22, 22, 23, 23, 24, 25, 25, 25, 26, 26, 27, 27, 28, 29, 30, 30, 30, 31, 32, 32, 32, 32, 33, 35, 35
Offset: 1

Views

Author

Reinhard Zumkeller, May 31 2013

Keywords

Comments

First numbers not occurring: 62, 66, 75, 79, 114, 123, ... .

Crossrefs

Programs

  • Haskell
    a226222 n = a226222_list !! (n-1)
    a226222_list = 1 : 1 : 1 : zipWith (+)
       (map a226222 $ zipWith (-) [3..] a226222_list)
       (map a226222 $ zipWith (-) [2..] $ tail a226222_list)
    -- Reinhard Zumkeller, May 31 2013
    
  • Mathematica
    a[n_]:= a[n]= If[n<4, 1, a[n-2 -a[n-2]] + a[n-1 -a[n-3]]];
    Table[a[n], {n, 80}] (* G. C. Greubel, Mar 28 2022 *)
  • Sage
    @CachedFunction
    def a(n): # A226222
        if (n<4): return 1
        else: return  a(n-2-a(n-2)) + a(n-1-a(n-3))
    [a(n) for n in (1..80)] # G. C. Greubel, Mar 28 2022

Formula

a(n) = a(n-2 - a(n-2)) + a(n-1 - a(n-3)), with a(1) = a(2) = a(3) = 1.