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.

A259615 a(0)=0, a(1)=a(2)=a(3)=a(4)=1; thereafter, a(n) = Sum_{k=1..5} a(n-k-(a(n-k) mod 5)).

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 4, 5, 9, 9, 11, 19, 23, 27, 45, 87, 105, 205, 401, 587, 747, 1121, 1763, 2145, 4085, 7965, 15529, 16545, 32503, 38323, 49767, 74305, 146847, 180069, 210427, 341745, 650987, 787109, 917411
Offset: 0

Views

Author

Anders Hellström, Jun 30 2015

Keywords

Crossrefs

Cf. A000322, A241154 (sequence obtained without mod 5 in formula).

Programs

  • Ruby
    def first(m)
        v=[0,1,1,1,1]
        for i in 5..m-1
          i2=0
          for j in 1..5
            r=i-j
            i2 += v[r-v[r]%5]
          end
          v << i2
        end
        v
    end
  • Sage
    def first(m):
        v=[0,1,1,1,1]
        for i in range(5,m+1):
          l=0
          for s in range(1,5+1):
            l += v[i-s-v[i-s]%5]
          v.append(l)
        return v