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.

A186111 a(n) = -n if n odd, a(2n) = 3n if n odd, a(4n) = 2n.

Original entry on oeis.org

1, -3, 3, -2, 5, -9, 7, -4, 9, -15, 11, -6, 13, -21, 15, -8, 17, -27, 19, -10, 21, -33, 23, -12, 25, -39, 27, -14, 29, -45, 31, -16, 33, -51, 35, -18, 37, -57, 39, -20, 41, -63, 43, -22, 45, -69, 47, -24, 49, -75, 51, -26, 53, -81, 55, -28, 57, -87, 59, -30, 61, -93, 63
Offset: 1

Views

Author

Michael Somos, Feb 13 2011

Keywords

Examples

			G.f. = x - 3*x^2 + 3*x^3 - 2*x^4 + 5*x^5 - 9*x^6 + 7*x^7 - 4*x^8 + 9*x^9 + ...
		

Crossrefs

Programs

  • Magma
    m:=25; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(x*(1-x)^3*(1-x^3)/(1-x^4)^2)); // G. C. Greubel, Aug 14 2018
  • Mathematica
    Rest[CoefficientList[Series[x (1-x)^3(1-x^3)/(1-x^4)^2,{x,0,70}],x]] (* or *) LinearRecurrence[{-2,-3,-4,-3,-2,-1},{1,-3,3,-2,5,-9},70] (* Harvey P. Dale, Aug 08 2012 *)
    a[ n_] := n If[ OddQ[n], 1, -(Mod[n/2, 2] + 1/2)]; (* Michael Somos, Apr 25 2015 *)
    a[ n_] := n {1, -3/2, 1, -1/2}[[Mod[n, 4, 1]]]; (* Michael Somos, Apr 25 2015 *)
  • PARI
    {a(n) = -(-1)^n * n * [1, 2, 3, 2] [n%4 + 1] / 2};
    
  • PARI
    {a(n) = sign(n) * polcoeff( x * (1 - x)^3 * (1 - x^3) / (1 - x^4)^2 + x * O(x^abs(n)), abs(n))};
    
  • PARI
    {a(n) = n * if( n%2, 1, -(n/2%2 + 1/2))}; /* Michael Somos, Apr 25 2015 */
    

Formula

a(n) is multiplicative with a(2) = -3, a(2^e) = -(2^(e-1)) if e>1, a(p^e) = p^e if p>2.
Euler transform of length 4 sequence [-3, 0, -1, 2].
G.f.: x * (1 - x)^3 * (1 - x^3) / (1 - x^4)^2.
G.f.: x * (1 + x + x^2) * (1 - x)^2 / ((1 + x)^2 * (1 + x^2)^2).
Dirichlet g.f. zeta(s-1)*( 1-5*2^(-s)+4^(1-s)). - R. J. Mathar, Mar 31 2011
a(n) = (-1)^(n+1)*n + (-1)^floor(n/2)*A027656(n-2). - R. J. Mathar, Mar 31 2011
a(n) = -2*a(n-1) - 3*a(n-2) - 4*a(n-3) - 3*a(n-4) - 2*a(n-5) - a(n-6) with a(1)=1, a(2)=-3, a(3)=3, a(4)=-2, a(5)=5, a(6)=-9. - Harvey P. Dale, Aug 08 2012
G.f.: 1/(1+x) - 1/(1+x)^2 - 1/(1+x^2) + 1/(1+x^2)^2. - Michael Somos, Apr 24 2015
a(n) = -a(-n) for all n in Z. - Michael Somos, Apr 24 2015
G.f.: f(x) - f(x^2) where f(x) := x / (1 + x)^2. - Michael Somos, May 07 2015
Moebius transform of A186690. - Michael Somos, Apr 25 2015
a(n) = -(-1)^n * A186813(n). - Michael Somos, May 07 2015
a(n) = n*cos(n*Pi/2)/2-n*(-1)^n. - Wesley Ivan Hurt, May 05 2021

A187601 n/2 times period 6 sequence [1, 2, 3, 4, 3, 2, ...].

Original entry on oeis.org

0, 1, 3, 6, 6, 5, 3, 7, 12, 18, 15, 11, 6, 13, 21, 30, 24, 17, 9, 19, 30, 42, 33, 23, 12, 25, 39, 54, 42, 29, 15, 31, 48, 66, 51, 35, 18, 37, 57, 78, 60, 41, 21, 43, 66, 90, 69, 47, 24, 49, 75, 102, 78, 53, 27, 55, 84, 114, 87, 59, 30, 61, 93, 126, 96, 65, 33, 67, 102
Offset: 0

Views

Author

Bruno Berselli, Mar 11 2011

Keywords

Comments

A007310 is a subsequence.

Crossrefs

Cf. A186813.
Cf. A109044, A088439 (by Superseeker).

Programs

  • Magma
    [(n/2)*[1, 2, 3, 4, 3, 2][n mod 6 + 1]: n in [0..68]]; /* Other: */ [n*(5-2*(-1)^Floor((n+1)/3)-(-1)^n)/4: n in [0..68]];
  • Mathematica
    CoefficientList[Series[x (1 + x + x^2 - x^3 + x^4 + x^5 + x^6) / ((1 - x)^2 (1 + x)^2 (1 - x + x^2)^2), {x, 0, 70}], x] (* Vincenzo Librandi, Aug 19 2013 *)
    LinearRecurrence[{2,-1,-2,4,-2,-1,2,-1},{0,1,3,6,6,5,3,7},90] (* Harvey P. Dale, Aug 20 2017 *)

Formula

a(n) = (n/2)*A028356(n).
G.f.: x*(1+x+x^2-x^3+x^4+x^5+x^6)/((1-x)^2*(1+x)^2*(1-x+x^2)^2).
a(-n) = -a(n). a(n) = 2*a(n-1)-a(n-2)-2*a(n-3)+4*a(n-4)-2*a(n-5)-a(n-6)+2*a(n-7)-a(n-8) for n>7.
a(n) = n*(5-2*(-1)^floor((n+1)/3)-(-1)^n)/4.
Showing 1-2 of 2 results.