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.

A305865 a(1) = 1, a(n) = -5*a(n/3) if n is divisible by 3, otherwise a(n) = n - a(n-1).

Original entry on oeis.org

1, 1, -5, 9, -4, -5, 12, -4, 25, -15, 26, -45, 58, -44, 20, -4, 21, 25, -6, 26, -60, 82, -59, 20, 5, 21, -125, 153, -124, 75, -44, 76, -130, 164, -129, 225, -188, 226, -290, 330, -289, 220, -177, 221, -100, 146, -99, 20, 29, 21, -105, 157, -104, -125, 180, -124, 30, 28, 31, -130, 191, -129, 300, -236, 301, -410, 477, -409, 295
Offset: 1

Views

Author

Altug Alkan, Aug 23 2018

Keywords

Crossrefs

Cf. A318265.

Programs

  • Maple
    f:= proc(n) option remember;
      if n mod 3 = 0 then -5*procname(n/3)
      else n - procname(n-1)
      fi
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Aug 24 2018
  • PARI
    a(n)=if(n==1, n, if(n%3==0, -5*a(n/3),n-a(n-1)));

Formula

G.f. g(x) satisfies g(x) = -5*(1-x+x^2)*g(x^3) + (1+x+2*x^3-x^4)*x/(1-x^3)^2. - Robert Israel, Aug 24 2018