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.

Showing 1-2 of 2 results.

A110091 Denominators of sequence of rationals defined by r(n) = n for n<=1 and for n>1: r(n) = (sum of denominators of r(n-1) and r(n-2))/(sum of numerators of r(n-1) and r(n-2)).

Original entry on oeis.org

1, 1, 1, 3, 1, 3, 5, 1, 5, 7, 1, 7, 9, 1, 9, 11, 1, 11, 13, 1, 13, 15, 1, 15, 17, 1, 17, 19, 1, 19, 21, 1, 21, 23, 1, 23, 25, 1, 25, 27, 1, 27, 29, 1, 29, 31, 1, 31, 33, 1, 33, 35, 1, 35, 37, 1, 37, 39, 1, 39, 41, 1, 41, 43, 1, 43, 45, 1, 45, 47, 1, 47, 49, 1, 49, 51, 1, 51, 53, 1, 53, 55
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 14 2005

Keywords

Crossrefs

Cf. A110090 (numerators).

Programs

  • Mathematica
    a[n_]:= a[n]= If[Mod[n, 3]==0, 2*Floor[n/3] +1, If[Mod[n, 3]==1, 1, 2*Floor[n/3] +1]]; Table[a[n], {n, 0, 100}] (* G. C. Greubel, Jun 16 2021 *)
  • Sage
    def A110091(n):
        if (n%3==0): return 2*(n//3) + 1
        elif (n%3==1): return 1
        else: return 2*(n//3) +1
    [A110091(n) for n in (0..100)] # G. C. Greubel, Jun 16 2021

Formula

a(3*k) = 2*k+1, a(3*k+1) = 1, a(3*k+2) = 2*k+1.
r(n) = A110090(n) / a(n).
a(n) = (A110090(n-1) + A110090(n-2))/GCD(a(n-1) + a(n-2), A110090(n-1) + A110090(n-2)).

A138189 Sequence built on pattern (1,-even,-even) beginning 1,-2,-2.

Original entry on oeis.org

1, -2, -2, 1, -4, -4, 1, -6, -6, 1, -8, -8, 1, -10, -10, 1, -12, -12, 1, -14, -14, 1, -16, -16, 1, -18, -18, 1, -20, -20, 1, -22, -22, 1, -24, -24, 1, -26, -26, 1, -28, -28, 1, -30, -30, 1, -32, -32, 1, -34, -34, 1, -36, -36, 1, -38, -38, 1, -40, -40
Offset: 0

Views

Author

Paul Barry, Mar 04 2008

Keywords

Comments

Partial sums of A138188.

Crossrefs

Programs

  • Magma
    b:= [n le 2 select 0 else Abs(2*Self(n-1) -Self(n-2)) -Self(n-1)-1: n in [1..120]];
    A138189:= func< n | -b[n+3] >;
    [A138189(n): n in [0..100]]; // G. C. Greubel, Jun 16 2021
    
  • Mathematica
    Join[{1},Riffle[Flatten[{-2#,-2#}&/@Range[25]],1,3]] (* Harvey P. Dale, Nov 02 2011 *)
  • Sage
    @CachedFunction
    def A138189(n):
        if (n%3==0): return 1
        elif (n%3==1): return -2*(n//3 +1)
        else: return -2*(n//3 +1)
    [A138189(n) for n in (0..100)] # G. C. Greubel, Jun 16 2021

Formula

G.f.: (1 -2*x -2*x^2 -x^3)/(1 -2*x^3 +x^6).
From G. C. Greubel, Jun 16 2021: (Start)
a(n) = -b(n+3), where b(n) = abs(2*b(n-1) - b(n-2)) - b(n-1) - 1 and b(1) = b(2) = 0.
a(n) = 1 if (n mod 3) = 0, -2*(floor(n/3) + 1) if (n mod 3) = 1 or (n mod 3) = 2. (End)
Showing 1-2 of 2 results.