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-8 of 8 results.

A130151 Period 6: repeat [1, 1, 1, -1, -1, -1].

Original entry on oeis.org

1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1
Offset: 0

Views

Author

Paul Curtz, Aug 03 2007

Keywords

Examples

			G.f. = 1 + x + x^2 - x^3 - x^4 - x^5 + x^6 + x^7 + x^8 - x^9 - x^10 - x^11 + ...
G.f. = q + q^3 + q^5 - q^7 - q^9 - q^11 + q^13 + q^15 + q^17 - q^19 - q^21 + ...
		

Crossrefs

Programs

Formula

a(n+6) = a(n), a(0)=a(1)=a(2)=-a(3)=-a(4)=-a(5)=1.
a(n) = ((-1)^n * (4 * (cos((2*n + 1)*Pi/3) + cos(n*Pi)) + 1) - 4) / 3. - Federico Acha Neckar (f0383864(AT)hotmail.com), Sep 01 2007
a(n) = (-1)^n * (4 * cos((2*n + 1) * Pi/3) + 1) / 3. - Federico Acha Neckar (f0383864(AT)hotmail.com), Sep 02 2007
G.f.: (1+x+x^2)/((1+x)*(x^2-x+1)). - R. J. Mathar, Nov 14 2007
a(n) = 3*a(n-1) - a(n-3) + 3*a(n-4) for n>3. - Paul Curtz, Nov 22 2007
a(n) = (-1)^floor(n/3). Compare with A057077, A143621 and A143622. Define E(k) = Sum_{n >= 0} a(n)*n^k/n! for k = 0,1,2,... . Then E(k) is an integral linear combination of E(0), E(1) and E(2) (a Dobinski-type relation). Precisely, E(k) = A143628(k)*E(0) + A143629(k)*E(1) + A143630(k)*E(2). - Peter Bala, Aug 28 2008
Euler transform of length 6 sequence [1, 0, -2, 0, 0, 1]. - Michael Somos, Feb 26 2011
a(n) = b(2*n + 1) where b(n) is multiplicative with b(2^e) = 0^e, b(3^e) = -(-1)^e if e>0, b(p^e) = 1 if p == 1 (mod 4), b(p^e) = (-1)^e if p == 3 (mod 4) and p>3. - Michael Somos, Feb 26 2011
a(n + 3) = a(-1 - n) = -a(n) for all n in Z. - Michael Somos, Feb 26 2011
a(n) = (-1)^n * A257075(n) for all n in Z. - Michael Somos, Apr 15 2015
G.f.: 1 / (1 - x / (1 + 2*x^2 / (1 + x / (1 + x / (1 - x))))). - Michael Somos, Apr 15 2015
From Wesley Ivan Hurt, Jul 05 2016: (Start)
a(n) + a(n-3) = 0 for n>2.
a(n) = (cos(n*Pi) + 2*cos(n*Pi/3) + 2*sqrt(3)*sin(n*Pi/3)) / 3. (End)
a(n)*a(n-4) = a(n-1)*a(n-3) for all n in Z. - Michael Somos, Feb 25 2020

A257075 a(n) = (-1)^(n mod 3).

Original entry on oeis.org

1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1
Offset: 0

Views

Author

Michael Somos, Apr 15 2015

Keywords

Comments

Period 3: repeat [1, -1, 1]. - Wesley Ivan Hurt, Jul 02 2016

Examples

			G.f. = 1 - x + x^2 + x^3 - x^4 + x^5 + x^6 - x^7 + x^8 + x^9 - x^10 + ...
G.f. = q - q^3 + q^5 + q^7 - q^9 + q^11 + q^13 - q^15 + q^17 + q^19 + ...
		

Crossrefs

Essentially the same as A131561.

Programs

  • Magma
    [(-1)^(n mod 3) : n in [0..100]]; // Wesley Ivan Hurt, Jul 02 2016
  • Maple
    A257075:=n->(-1)^(n mod 3): seq(A257075(n), n=0..100); # Wesley Ivan Hurt, Jul 02 2016
  • Mathematica
    a[ n_] := (-1)^Mod[n, 3]; Table[a[n], {n, 0, 100}]
    LinearRecurrence[{0,0,1},{1,-1,1},80] (* or *) PadRight[{},100,{1,-1,1}] (* Harvey P. Dale, May 25 2023 *)
  • PARI
    {a(n) = (-1)^(n%3)};
    
  • PARI
    {a(n) = 1 - 2 * (n%3 == 1)};
    
  • PARI
    {a(n) = [1, -1, 1][n%3 + 1]};
    
  • PARI
    {a(n) = my(A, p, e); n = abs(2*n + 1); A = factor(n); prod( k=1, matsize(A)[1], [p, e] = A[k,]; if( p==2, 0, p==3, -1, 1))};
    

Formula

Euler transform of length 6 sequence [-1, 1, 2, 0, 0, -1].
a(n) = b(2*n + 1) where b() is multiplicative with b(2^e) = 0^e, b(3^e) = -1 if e>0, otherwise b(p^e) = 1.
a(n) = a(-1-n) = a(n+3) = -a(n-1)*a(n-2) for all n in Z.
G.f.: (1 - x + x^2) / (1 - x^3).
G.f.: (1 - x) * (1 - x^6) / ((1 - x^2) * (1 - x^3)^2).
G.f.: 1 / (1 + x / (1 + 2*x^2 / (1 - x / (1 - x / (1 + x))))).
Given g.f. A(x), then x*A(x^2) = Sum_{k>0} (x^k - x^(2*k)) - 2*(x^(3*k) - x^(6*k)).
a(n) = A131561(n+1) for all n in Z.
a(n) = (-1)^n * A130151(n) for all n in Z.
Convolution inverse is A257076.
PSUM transform is A008611.
BINOMIAL transform is A086953.
1 / (1 - a(0)*x / (1 - a(1)*x / (1 - a(2)*x / ...))) is the g.f. of A168505.
From Wesley Ivan Hurt, Jul 02 2016: (Start)
a(n) = (1 + 2*cos(2*n*Pi/3) - 2*sqrt(3)*sin(2*n*Pi/3))/3.
a(n) = 2*sgn((n+2) mod 3) - 1. (End)
E.g.f.: (exp(3*x/2) + 4*sin(Pi/6-sqrt(3)*x/2))*exp(-x/2)/3. - Ilya Gutkovskiy, Jul 02 2016

A181482 The sum of the first n integers, with every third integer taken negative.

Original entry on oeis.org

1, 3, 0, 4, 9, 3, 10, 18, 9, 19, 30, 18, 31, 45, 30, 46, 63, 45, 64, 84, 63, 85, 108, 84, 109, 135, 108, 136, 165, 135, 166, 198, 165, 199, 234, 198, 235, 273, 234, 274, 315, 273, 316, 360, 315, 361, 408, 360, 409, 459, 408, 460, 513, 459, 514, 570, 513, 571, 630
Offset: 1

Views

Author

Jon Perry, Oct 23 2010

Keywords

Comments

The partial sum for the first 10^k terms are 76, 57256, 55722556, 55572225556, 55557222255556,..., i.e., the palindrome 5{k}2{k-1}5{k} plus 1+2*10^(2*k-1). - R. J. Cano, Mar 10 2013, edited by M. F. Hasler, Mar 25 2013

Examples

			a(7) = 1 + 2 - 3 + 4 + 5 - 6 + 7 = 10.
		

Crossrefs

Programs

  • Haskell
    a181482 n = a181482_list !! (n-1)
    a181482_list = scanl1 (+) $ zipWith (*) [1..] $ cycle [1, 1, -1]
    -- Reinhard Zumkeller, Nov 23 2014
  • JavaScript
    c = 0; for (i = 1; i < 100; i++) {c += Math.pow(-1, (i + 1) % 3)*i; document.write(c, ", ");} // Jon Perry, Feb 17 2013
    
  • JavaScript
    c=0; for (i = 1; i < 100; i++) { c += (1 - (i + 1) % 3 % 2 * 2) * i; document.write(c + ", "); } // Jon Perry, Mar 03 2013
    
  • Magma
    I:=[1,3,0,4,9,3,10]; [n le 7 select I[n] else Self(n-1)+2*Self(n-3)-2*Self(n-4)-Self(n-6)+Self(n-7): n in [1..60]]; // Vincenzo Librandi, Feb 17 2013
    
  • Mathematica
    a[n_] := Sum[If[Mod[j, 3] == 0, -j, j], {j, 1, n}]; Table[a[i], {i, 1, 50, 1}] (* Jon Perry *)
    tri[n_] := n (n + 1)/2; f[n_] := tri@ n - 6 tri@ Floor[n/3]; Array[f, 63] (* Robert G. Wilson v, Oct 24 2010 *)
    CoefficientList[Series[-(1 + 2*x + 2*x^3 + x^4 - 3*x^2)/((1 + x + x^2)^2*(x - 1)^3), {x, 0,30}], x] (* Vincenzo Librandi, Feb 17 2013 *)
    Table[Sum[k * (-1)^Boole[Mod[k, 3] == 0], {k, n}], {n, 60}] (* Alonso del Arte, Feb 24 2013 *)
    With[{nn=20},Accumulate[Times@@@Partition[Riffle[Range[3nn],{1,1,-1}],2]]] (* Harvey P. Dale, Feb 09 2015 *)
  • PARI
    a(n)=sum(k=1,n,k*((-1)^(k%3==0)) )  \\ R. J. Cano, Feb 26 2013
    
  • PARI
    a(n)={my(y=n\3);n*(n+1)\2-3*y*(y+1)} \\ R. J. Cano, Feb 28 2013
    

Formula

From R. J. Mathar, Oct 23 2010: (Start)
a(n) = a(n-1) + 2*a(n-3) - 2*a(n-4) - a(n-6) + a(n-7).
G.f.: -x*(1+2*x+2*x^3+x^4-3*x^2) / ( (1+x+x^2)^2*(x-1)^3 ).
a(n) = 2*A061347(n+1)/9 +4/9 + n*(n+1)/6 + 2*b(n)/3 where b(3k+1) = 0, b(3k) = -3k - 1 and b(3k+2) = 3k + 3. (End)
a(n) = sum((i+1)*A131561(i), i=0..n-1) = A000217(n)-6*A000217(floor(n/3)). [Bruno Berselli, Dec 10 2010]
a(0) = 0, a(n) = a(n-1) + (-1)^((n + 1) mod 3)*n - Jon Perry, Feb 17 2013
a(n) = n*(n+1)/2-3*floor(n/3)*(floor(n/3)+1). - R. J. Cano, Mar 01 2013 [Same as Berselli's formula. - Ed.]
a(3k) = 3k(k-1)/2. - Jon Perry, Mar 01 2013
a(0) = 0, a(n) = a(n-1) + (1 - ((n+1) mod 3 mod 2) * 2) * n. - Jon Perry, Mar 03 2013

Extensions

More terms added by R. J. Mathar, Oct 23 2010

A168505 Expansion of 1/(1-x/(1+x/(1-x/(1-x/(1+x/(1-x/(1-x/(1+x/(1-... (continued fraction).

Original entry on oeis.org

1, 1, 0, -1, -2, -2, 0, 5, 12, 16, 6, -32, -102, -170, -130, 199, 966, 1978, 2192, -650, -9292, -23624, -33760, -12138, 84440, 280852, 493932, 397668, -639676, -3248464, -6947460, -8068587, 2165980, 35591960, 94129446, 139864828, 56393482, -352505722
Offset: 0

Views

Author

Paul Barry, Nov 27 2009

Keywords

Comments

Hankel transform is A131561(n+1). First column of array whose production matrix begins
1, 1;
-1, 0, 1;
0, 1, 0, 1;
0, 0, -1, 2, 1;
0, 0, 0, -1, 0, 1;
0, 0, 0, 0, 1, 0, 1;
0, 0, 0, 0, 0, -1, 2, 1;

Examples

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

Programs

  • PARI
    {a(n) = if( n<0, 0, polcoeff( (1 + x - sqrt(1 - 2*x + x^2 + 4*x^3 + x^2 * O(x^n))) / (2*x*(1 - x)), n))}; /* Michael Somos, Jan 20 2017 */

Formula

G.f.: 1/(1-x+x^2/(1-x^2/(1+x^2/(1-2x+x^2/(1-x^2/(1+x^2/(1-2x+x^2/(1-x^2/(1+... (continued fraction, defined by the sequences (1,0,0,2,0,0,2,0,0,2,0,...) and (-1,1,-1,-1,1,-1,...));
g.f.: (1+x-sqrt(1-2x+x^2+4x^3))/(2x(1-x)).
a(n) = Sum_{k=0..n} A198379(n,k)*(-1)^(n-k). - Philippe Deléham, Oct 29 2011
a(n) = (-1)^n*Sum_{k=0..n} A174014(n,k)*(-2)^k. - Philippe Deléham, Feb 16 2012
G.f.: (1+x)/(G(0)+x), where G(k) = 1 - x + x^3/G(k+1); (continued fraction). - Sergei N. Gladkovskii, Jul 29 2013
Conjecture: (n+1)*a(n) - 3*n*a(n-1) + 3*(n-1)*a(n-2) + 3*(n-4)*a(n-3) + 2*(-2*n+7)*a(n-4) = 0. - R. J. Mathar, Feb 10 2015
G.f. A(x) satisfies (A(x) - 1) / A(x)^2 = (x - x^2) / (1 + x). - Michael Somos, Jan 20 2017
0 = a(n)*(+16*a(n+1) - 6*a(n+2) - 42*a(n+3) + 54*a(n+4) - 22*a(n+5)) + a(n+1)*(-18*a(n+1) + 27*a(n+2) + 6*a(n+3) - 31*a(n+4) + 18*a(n+5))+ a(n+2)*(-18*a(n+2) + 36*a(n+3) - 30*a(n+4) + 9*a(n+5)) + a(n+3)*(+6*a(n+4) - 6*a(n+5)) + a(n+4)*(+a(n+5)) if n >= 0. - Michael Somos, Jan 20 2017

A255353 Denominators in an expansion of 3 - sqrt(5) as a sum of fractions +-1/d.

Original entry on oeis.org

2, 3, 6, 15, 24, 40, 104, 168, 273, 714, 1155, 1870, 4895, 7920, 12816, 33552, 54288, 87841, 229970, 372099, 602070, 1576239, 2550408, 4126648, 10803704, 17480760, 28284465, 74049690, 119814915, 193864606, 507544127, 821223648, 1328767776
Offset: 1

Views

Author

Mohammad K. Azarian, Feb 21 2015

Keywords

Comments

The minus sign in front of a fraction is considered the sign of the numerator and hence the sign of the fraction does not appear in this sequence. We note that numerators are in A131561.

Examples

			1/(1*2) + 1/(1*3) - 1/(2*3) + 1/(3*5) + 1/(3*8) - 1/(5*8) + 1/(8*13) + 1/(8*21) - 1/(13*21) + 1/(21*34) + 1/(21*55) - 1/(34*55) + ... + = 3 - sqrt(5).
		

Crossrefs

Programs

  • Mathematica
    Table[SeriesCoefficient[x (2 + 3 x + 6 x^2 - x^3 - 8 x^5 + x^8)/((1 - x) (1 + x + x^2) (1 - 7 x^3 + x^6)), {x, 0, n}], {n, 33}] (* Michael De Vlieger, Dec 17 2015 *)
  • PARI
    Vec(x*(2+3*x+6*x^2-x^3-8*x^5+x^8)/((1-x)*(1+x+x^2)*(1-7*x^3+x^6)) + O(x^40)) \\ Colin Barker, Dec 17 2015

Formula

3 - sqrt(5) = Sum_{n>=1} 1/(F(2*n)*F(2*n+1)) + 1/(F(2*n)*F(2*n+2)) - 1/(F(2*n+1)*F(2*n+2)), where F = A000045 (Fibonacci numbers).
From Colin Barker, Dec 17 2015: (Start)
a(n) = 8*a(n-3) - 8*a(n-6) + a(n-9) for n>9.
G.f.: x*(2+3*x+6*x^2-x^3-8*x^5+x^8) / ((1-x)*(1+x+x^2)*(1-7*x^3+x^6)).
(End)

A329583 Numerators of 1 + n^2/4 + period 3: repeat [-1, 1, 1].

Original entry on oeis.org

0, 6, 3, 12, 6, 30, 9, 54, 18, 84, 27, 126, 36, 174, 51, 228, 66, 294, 81, 366, 102, 444, 123, 534, 144, 630, 171, 732, 198, 846, 225, 966, 258, 1092, 291, 1230, 324, 1374, 363, 1524, 402, 1686, 441, 1854, 486, 2028, 531, 2214, 576, 2406, 627
Offset: 0

Views

Author

Paul Curtz, Nov 17 2019

Keywords

Comments

First bisection is 3*A008810.

Crossrefs

Programs

  • Mathematica
    MapIndexed[#1 - 2 Boole[Mod[First@ #2, 3] == 1] + 1 &, CoefficientList[Series[(1 + 5 x - x^2 - 2 x^3 + 2 x^4 + 5 x^5)/(1 - x^2)^3, {x, 0, 44}], x]] (* Michael De Vlieger, Nov 18 2019 *)
  • PARI
    concat(0, Vec(3*x*(2 + 3*x + x^2 - 2*x^3 + x^4 + 3*x^5 + 2*x^6) / ((1 - x)^3*(1 + x)^3*(1 + x + x^2)) + O(x^40))) \\ Colin Barker, Nov 24 2019

Formula

a(n) = A261327(n) + A131561(n+2) = (n^2 + 4)*(5 - 3*(-1)^n)/8 + (-1)^((n+1) mod 3).
From Colin Barker, Nov 24 2019: (Start)
G.f.: 3*x*(2 + 3*x + x^2 - 2*x^3 + x^4 + 3*x^5 + 2*x^6) / ((1 - x)^3*(1 + x)^3*(1 + x + x^2)).
a(n) = -a(n-1) + 2*a(n-2) + 3*a(n-3) - 3*a(n-5) - 2*a(n-6) + a(n-7) + a(n-8) for n>8. (End)

Extensions

Incorrect 129 replaced with 123 by Colin Barker, Nov 24 2019

A377226 Take the sequence of the signed denominators of Leibniz series for Pi/4 (cf. A157142) and permute the terms so that a negative term follows every two positive terms and the absolute difference between two consecutive terms of the same sign is 4.

Original entry on oeis.org

1, 5, -3, 9, 13, -7, 17, 21, -11, 25, 29, -15, 33, 37, -19, 41, 45, -23, 49, 53, -27, 57, 61, -31, 65, 69, -35, 73, 77, -39, 81, 85, -43, 89, 93, -47, 97, 101, -51, 105, 109, -55, 113, 117, -59, 121, 125, -63, 129, 133, -67, 137, 141, -71, 145, 149, -75, 153, 157, -79, 161
Offset: 0

Views

Author

Stefano Spezia, Oct 20 2024

Keywords

References

  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Section 1.4.1, p. 20.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{0,0,2,0,0,-1},{1,5,-3,9,13,-7},61]

Formula

a(n) = 2*a(n-3) - a(n-6) for n > 5.
a(n)= (9 + 12*n - 6*n*A061347(n) + 6*(2 + 3*n)*A049347(n+2))/9.
G.f.: (1 + 5*x - 3*x^2 + 7*x^3 + 3*x^4 - x^5)/(1 - x^3)^2.
E.g.f.: exp(-x/2)*(3*exp(3*x/2)*(3 + 4*x) + 12*x*cos(sqrt(3)*x/2) + 4*sqrt(3)*(2 - 3*x)*sin(sqrt(3)*x/2))/9.
Sum_{n>=0} 1/a(n) = (log(2) + Pi)/4 = A377227.

A226122 Expansion of (1+2*x+x^2+x^3+2*x^4+x^5)/(1-2*x^3+x^6).

Original entry on oeis.org

1, 2, 1, 3, 6, 3, 5, 10, 5, 7, 14, 7, 9, 18, 9, 11, 22, 11, 13, 26, 13, 15, 30, 15, 17, 34, 17, 19, 38, 19, 21, 42, 21, 23, 46, 23, 25, 50, 25, 27, 54, 27, 29, 58, 29, 31, 62, 31, 33, 66, 33, 35, 70, 35, 37, 74, 37, 39, 78, 39
Offset: 0

Views

Author

Paul Curtz, May 27 2013

Keywords

Comments

A226023 (starting from A226023(-2)=0) and successive differences:
0, -1, 0, 2, 3, 6, 12, 15, 20, 30,...
-1, 1, 2, 1, 3, 6, 3, 5, 10, 5,... = a(n-1)
2, 1, -1, 2, 3, -3, 2, 5, -5, 2,...
-1, -2, 3, 1, -6, 5, 3, -10, 7, 5,...
-1, 5, -2, -7, 11, -2, -13, 17, -2, -19,...
6, -7, -5, 18, -13, -11, 30, -19, -17, 42,...
-13, 2, 23, -31, 2, 41, -49, 2, 59, 67,...
15, 21, -54, 33, 39, -90, 51, 57, -126, 69,... multiples of 3
6, -75, 87, 6, -129, 141, 6, -183, 195, 6,... multiples of 3
-81, 162, -81, -135, 270, -135, -189, 378, -189, -243,... multiples of 27
The last line is -27*a(n+3)*A131561(n+1).
The recurrences in the Formula field hold for the array.

Examples

			Given A130823 = 1,1,1,3,3,3,5,5,5,7,7,7,... and A131534 = 1,2,1,1,2,1,1,2,1,1,2,1,..., then a(0)=1*1=1, a(1)=1*2=2, a(2)=1*1=1, a(3)=3*1=3, a(4)=3*2=6, etc.
Given A226023(n) from A226023(-1)=-1, then a(0)=0-(-1)=1, a(1)=2-0=2, a(2)=3-2=1, a(3)=6-3=3, a(4)=12-6=6, etc.
		

Crossrefs

Programs

  • Mathematica
    repeat=20; Table[{1, 2, 1}, {repeat}]*(2*Range[repeat]-1) // Flatten
    (* or *) Table[Floor[(2*n+1)/3]*Floor[(2*n+5)/3], {n, -1, 59}] // Differences (* Jean-François Alcover, May 29 2013 *)

Formula

a(n) = A130823(n-1) * A131534(n).
a(n) = A226023(n) - A226023(n-1) with A226023(-1)=-1.
a(n) = 3*a(n-3) -3*a(n-6) +a(n-9) = a(n-1) +2*a(n-3) -2*a(n-4) -a(n-6) +a(n-7). [Ralf Stephan]
From Bruno Berselli, May 29 2013: (Start)
G.f.: (1+x)^3*(1-x+x^2)/((1-x)^2*(1+x+x^2)^2).
a(n) = 2*a(n-3)-a(n-6).
a(3n)*a(3n-1)-a(3n-2) = A016754(n-1), n>0. (End)
Showing 1-8 of 8 results.