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.

A048573 a(n) = a(n-1) + 2*a(n-2), a(0)=2, a(1)=3.

Original entry on oeis.org

2, 3, 7, 13, 27, 53, 107, 213, 427, 853, 1707, 3413, 6827, 13653, 27307, 54613, 109227, 218453, 436907, 873813, 1747627, 3495253, 6990507, 13981013, 27962027, 55924053, 111848107, 223696213, 447392427, 894784853, 1789569707, 3579139413, 7158278827, 14316557653
Offset: 0

Views

Author

Michael Somos, Jun 17 1999

Keywords

Comments

Number of positive integers requiring exactly n signed bits in the modified non-adjacent form representation. - Ralf Stephan, Aug 02 2003
The n-th entry (n>1) of the sequence is equal to the 1,1-entry of the n-th power of the unnormalized 4 X 4 Haar matrix: [1 1 1 0 / 1 1 -1 0 / 1 1 0 1 / 1 1 0 -1]. - Simone Severini, Oct 27 2004
Pisano period lengths: 1, 1, 6, 2, 2, 6, 6, 2, 18, 2, 10, 6, 12, 6, 6, 2, 8, 18, 18, 2, ... - R. J. Mathar, Aug 10 2012
For n >= 1, a(n) is the number of ways to tile a strip of length n+2 with blue squares and blue and red dominos, with the restriction that the first two tiles must be the same color. - Guanji Chen and Greg Dresden, Jul 15 2024

Examples

			G.f. = 2 + 3*x + 7*x^2 + 13*x^3 + 27*x^4 + 53*x^5 + 107*x^6 + 213*x^7 + 427*x^8 + ...
		

Crossrefs

Programs

  • Magma
    [(5*2^n+(-1)^n)/3: n in [0..35]]; // Vincenzo Librandi, Jul 05 2011
    
  • Mathematica
    LinearRecurrence[{1,2},{2,3},40] (* Harvey P. Dale, Dec 11 2017 *)
  • PARI
    {a(n) = if( n<0, 0, (5*2^n + (-1)^n) / 3)};
    
  • PARI
    {a(n) = if (n<0 ,0, if( n<2, n+2, a(n-1) + 2*a(n-2)))};
    
  • Sage
    [(5*2^n+(-1)^n)/3 for n in range(35)] # G. C. Greubel, Apr 10 2019

Formula

G.f.: (2 + x) / (1 - x - 2*x^2).
a(n) = (5*2^n + (-1)^n) / 3.
a(n) = 2^(n+1) - A001045(n).
a(n) = A084170(n)+1 = abs(A083581(n)-3) = A081254(n+1) - A081254(n) = A084214(n+2)/2.
a(n) = 2*A001045(n+1) + A001045(n) (note that 2 is the limit of A001045(n+1)/A001045(n)). - Paul Barry, Sep 14 2009
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=-3, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=1, a(n-1)=-charpoly(A,-1). - Milan Janjic, Jan 27 2010
Equivalently, with different offset, a(n) = b(n+1) with b(0)=1 and b(n) = Sum_{i=0..n-1} (-1)^i (1 + (-1)^i b(i)). - Olivier Gérard, Jul 30 2012
a(n) = A000975(n-2)*10 + 5 + 2*(-1)^(n-2), a(0)=2, a(1)=3. - Yuchun Ji, Mar 18 2019
a(n+1) = Sum_{i=0..n} a(i) + 1 + (1-(-1)^n)/2, a(0)=2. - Yuchun Ji, Apr 10 2019
a(n) = 2^n + J(n+1) = J(n+2) + J(n+1) - J(n), where J is A001045. - Yuchun Ji, Apr 10 2019
a(n) = A001045(n+2) + A078008(n) = A062510(n+1) - A078008(n+1) = (A001045(n+2) + A062510(n+1))/2 = A014551(n) + 2*A001045(n). - Paul Curtz, Jul 14 2021
From Thomas Scheuerle, Jul 14 2021: (Start)
a(n) = A083322(n) + A024493(n).
a(n) = A127978(n) - A102713(n).
a(n) = A130755(n) - A166249(n).
a(n) = A007679(n) + A139763(n).
a(n) = A168642(n) XOR A007283(n).
a(n) = A290604(n) + A083944(n). (End)
From Paul Curtz, Jul 21 2021: (Start)
a(n) = 5*A001045(n) - A280560(n+1) = abs(A140360(n+1)) - A280560(n+1).
a(n) = 2^n + A001045(n+1) = A001045(n+3) - A000079(n).
a(n) = A001045(n+4) - A340627(n). (End)
a(n) = A001045(n+5) - A005010(n).
a(n+1) + a(n) = a(n+2) - a(n) = 5*2^n. - Michael Somos, Feb 22 2023
a(n) = A135318(2*n) + A135318(2*n+1) = A112387(2*n) + A112387(2*n+1). - Paul Curtz, Jun 26 2024
E.g.f.: (cosh(x) + 5*cosh(2*x) - sinh(x) + 5*sinh(2*x))/3. - Stefano Spezia, May 18 2025

Extensions

Formula of Milan Janjic moved here from wrong sequence by Paul D. Hanna, May 29 2010

A100218 Riordan array ((1-2*x)/(1-x), (1-x)).

Original entry on oeis.org

1, -1, 1, -1, -2, 1, -1, 0, -3, 1, -1, 0, 2, -4, 1, -1, 0, 0, 5, -5, 1, -1, 0, 0, -2, 9, -6, 1, -1, 0, 0, 0, -7, 14, -7, 1, -1, 0, 0, 0, 2, -16, 20, -8, 1, -1, 0, 0, 0, 0, 9, -30, 27, -9, 1, -1, 0, 0, 0, 0, -2, 25, -50, 35, -10, 1, -1, 0, 0, 0, 0, 0, -11, 55, -77, 44, -11, 1, -1, 0, 0, 0, 0, 0, 2, -36, 105, -112, 54, -12, 1
Offset: 0

Views

Author

Paul Barry, Nov 08 2004

Keywords

Examples

			Triangle begins as:
   1;
  -1,  1;
  -1, -2,  1;
  -1,  0, -3,  1;
  -1,  0,  2, -4,  1;
  -1,  0,  0,  5, -5,   1;
  -1,  0,  0, -2,  9,  -6,   1;
  -1,  0,  0,  0, -7,  14,  -7,  1;
  -1,  0,  0,  0,  2, -16,  20, -8,  1;
  -1,  0,  0,  0,  0,   9, -30, 27, -9,  1;
		

Crossrefs

Row sums are A100219.
Matrix inverse of A100100.
Apart from signs, same as A098599.
Very similar to triangle A111125.

Programs

  • Magma
    A100218:= func< n,k | n eq 0 select 1 else (-1)^(n+k)*(Binomial(k,n-k) + Binomial(k-1,n-k-1)) >;
    [A100218(n,k): k in [0..n], n in [0..13]]; // G. C. Greubel, Mar 28 2024
    
  • Mathematica
    T[0,0]:= 1; T[1,1]:= 1; T[1,0]:= -1; T[n_, k_]:= T[n, k]= If[k<0 || k>n, 0, T[n- 1,k] +T[n-1,k-1] -2*T[n-2,k-1] +T[n-3,k-1]]; Table[T[n,k], {n,0,14}, {k,0,n} ]//Flatten (* G. C. Greubel, Mar 13 2017 *)
  • SageMath
    def A100218(n,k): return 1 if n==0 else (-1)^(n+k)*(binomial(k,n-k) + binomial(k-1,n-k-1))
    flatten([[A100218(n,k) for k in range(n+1)] for n in range(14)]) # G. C. Greubel, Mar 28 2024

Formula

Sum_{k=0..n} T(n, k) = A100219(n) (row sums).
Number triangle T(n, k) = (-1)^(n-k)*(binomial(k, n-k) + binomial(k-1, n-k-1)), with T(0, 0) = 1. - Paul Barry, Nov 09 2004
T(n,k) = T(n-1,k) + T(n-1,k-1) - 2*T(n-2,k-1) + T(n-3,k-1), T(0,0)=1, T(1,0)=-1, T(1,1)=1, T(n,k)=0 if k < 0 or if k > n. - Philippe Deléham, Jan 09 2014
From G. C. Greubel, Mar 28 2024: (Start)
T(n, n-1) = A000027(n), n >= 1.
T(n, n-2) = -A080956(n-1), n >= 2.
T(2*n, n) = A280560(n).
T(2*n-1, n) = A157142(n-1), n >= 1.
T(2*n+1, n) = -A000007(n) = A154955(n+2).
T(3*n, n) = T(4*n, n) = A000007(n).
Sum_{k=0..n} (-1)^k*T(n, k) = A355021(n).
Sum_{k=0..floor(n/2)} T(n-k, k) = (-1)^n*A098601(n).
Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = -1 + 2*A077961(n) + A077961(n-2). (End)
From Peter Bala, Apr 28 2024: (Start)
This Riordan array has the form ( x*h'(x)/h(x), h(x) ) with h(x) = x*(1 - x) and hence belongs to the hitting time subgroup of the Riordan group (see Peart and Woan for properties of this subgroup).
T(n,k) = [x^(n-k)] (1/c(x))^n, where c(x) = (1 - sqrt(1 - 4*x))/(2*x) is the g.f. of the Catalan numbers A000108. In general the (n, k)-th entry of the hitting time array ( x*h'(x)/h(x), h(x) ) has the form [x^(n-k)] f(x)^n, where f(x) = x/( series reversion of h(x) ). (End)

A112465 Riordan array (1/(1+x), x/(1-x)).

Original entry on oeis.org

1, -1, 1, 1, 0, 1, -1, 1, 1, 1, 1, 0, 2, 2, 1, -1, 1, 2, 4, 3, 1, 1, 0, 3, 6, 7, 4, 1, -1, 1, 3, 9, 13, 11, 5, 1, 1, 0, 4, 12, 22, 24, 16, 6, 1, -1, 1, 4, 16, 34, 46, 40, 22, 7, 1, 1, 0, 5, 20, 50, 80, 86, 62, 29, 8, 1, -1, 1, 5, 25, 70, 130, 166, 148, 91, 37, 9, 1, 1, 0, 6, 30, 95, 200, 296, 314, 239, 128, 46, 10, 1
Offset: 0

Views

Author

Paul Barry, Sep 06 2005

Keywords

Comments

Inverse is A112466. Note that C(n,k) = Sum_{j = 0..n-k} C(j+k-1, j).

Examples

			Triangle starts
   1;
  -1, 1;
   1, 0, 1;
  -1, 1, 1,  1;
   1, 0, 2,  2,  1;
  -1, 1, 2,  4,  3,  1;
   1, 0, 3,  6,  7,  4,  1;
  -1, 1, 3,  9, 13, 11,  5, 1;
   1, 0, 4, 12, 22, 24, 16, 6, 1;
Production matrix begins
  -1, 1;
   0, 1, 1;
   0, 0, 1, 1;
   0, 0, 0, 1, 1;
   0, 0, 0, 0, 1, 1;
   0, 0, 0, 0, 0, 1, 1;
   0, 0, 0, 0, 0, 0, 1, 1;
   0, 0, 0, 0, 0, 0, 0, 1, 1; - _Paul Barry_, Apr 08 2011
		

Crossrefs

Columns: A033999(n) (k=0), A000035(n) (k=1), A004526(n) (k=2), A002620(n-1) (k=3), A002623(n-4) (k=4), A001752(n-5) (k=5), A001753(n-6) (k=6), A001769(n-7) (k=7), A001779(n-8) (k=8), A001780(n-9) (k=9), A001781(n-10) (k=10), A001786(n-11) (k=11), A001808(n-12) (k=12).
Diagonals: A000012(n) (k=n), A023443(n) (k=n-1), A152947(n-1) (k=n-2), A283551(n-3) (k=n-3).
Main diagonal: A072547.
Sums: A078008 (row), A078024 (diagonal), A092220 (signed diagonal), A280560 (signed row).

Programs

  • Haskell
    a112465 n k = a112465_tabl !! n !! k
    a112465_row n = a112465_tabl !! n
    a112465_tabl = iterate f [1] where
       f xs'@(x:xs) = zipWith (+) ([-x] ++ xs ++ [0]) ([0] ++ xs')
    -- Reinhard Zumkeller, Jan 03 2014
    
  • Magma
    A112465:= func< n,k | (-1)^(n+k)*(&+[(-1)^j*Binomial(j+k-1,j): j in [0..n-k]]) >;
    [A112465(n,k): k in [0..n], n in [0..13]]; // G. C. Greubel, Apr 18 2025
    
  • Mathematica
    T[n_, k_]:= Sum[Binomial[j+k-1, j]*(-1)^(n-k-j), {j, 0, n-k}];
    Table[T[n,k], {n,0,12}, {k,0,n}]//Flatten (* Jean-François Alcover, Jul 23 2018 *)
  • SageMath
    def A112465(n,k): return (-1)^(n+k)*sum((-1)^j*binomial(j+k-1,j) for j in range(n-k+1))
    print(flatten([[A112465(n,k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Apr 18 2025

Formula

Number triangle T(n, k) = Sum_{j=0..n-k} (-1)^(n-k-j)*C(j+k-1, j).
T(2*n, n) = A072547(n) (main diagonal). - Paul Barry, Apr 08 2011
From Reinhard Zumkeller, Jan 03 2014: (Start)
T(n, k) = T(n-1, k-1) + T(n-1, k), 0 < k < n, with T(n, 0) = (-1)^n and T(n, n) = 1.
T(n, k) = A108561(n, n-k). (End)
T(n, k) = T(n-1, k-1) + T(n-2, k) + T(n-2, k-1), T(0, 0) = 1, T(1, 0) = -1, T(1, 1) = 1, T(n, k) = 0 if k < 0 or if k > n. - Philippe Deléham, Jan 11 2014
exp(x) * e.g.f. for row n = e.g.f. for diagonal n. For example, for n = 3 we have exp(x)*(-1 + x + x^2/2! + x^3/3!) = -1 + 2*x^2/2! + 6*x^3/3! + 13*x^4/4! + .... The same property holds more generally for Riordan arrays of the form ( f(x), x/(1 - x) ). - Peter Bala, Dec 21 2014

A084100 Expansion of (1+x-x^2-x^3)/(1+x^2).

Original entry on oeis.org

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

Views

Author

Paul Barry, May 15 2003

Keywords

Comments

Partial sums are A084099.
The unsigned sequence 1,1,2,2,2,2,.. has g.f. (1+x^2)/(1-x) and a(n)=sum{k=0..n, binomial(1,k/2)(1+(-1)^k)/2}. Its partial sums are A004275(n+1). The sequence 1,-1,2,-2,2,-2,... has g.f. (1+x^2)/(1+x) and a(n)=sum{k=0..n, (-1)^(n-k)binomial(1,k/2)(1+(-1)^k)/2}. - Paul Barry, Oct 15 2004

Examples

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

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1+x-x^2-x^3)/(1+x^2),{x,0,100}],x]  (* Harvey P. Dale, Apr 20 2011 *)
    a[ n_] := (-1)^Quotient[n, 2] If[ Quotient[n, 2] != 0, 2, 1]; (* Michael Somos, Jan 05 2017 *)
  • PARI
    {a(n) = (-1)^(n\2) * if( n\2, 2, 1)}; /* Michael Somos, Jan 05 2017 */

Formula

Euler transform of length 4 sequence [1, -3, 0, 1]. - Michael Somos, Jan 05 2017
G.f.: (1 + x) * (1 - x^2) / (1 + x^2). - Michael Somos, Jan 05 2017
a(n) = a(1-n) for all n in Z. - Michael Somos, Jan 05 2017
a(2*n) = a(2*n + 1) = A280560(n) for all n in Z. - Michael Somos, Jan 05 2017

A104563 A floretion-generated sequence relating to centered square numbers.

Original entry on oeis.org

0, 1, 3, 5, 8, 13, 19, 25, 32, 41, 51, 61, 72, 85, 99, 113, 128, 145, 163, 181, 200, 221, 243, 265, 288, 313, 339, 365, 392, 421, 451, 481, 512, 545, 579, 613, 648, 685, 723, 761, 800, 841, 883, 925, 968, 1013, 1059, 1105, 1152, 1201, 1251
Offset: 0

Views

Author

Creighton Dement, Mar 15 2005

Keywords

Comments

Floretion Algebra Multiplication Program, FAMP Code: a(n) = 1vesrokseq[A*B] with A = - .5'i - .5i' + .5'ii' + .5e, B = + .5'ii' - .5'jj' + .5'kk' + .5e. RokType: Y[sqa.Findk()] = Y[sqa.Findk()] + Math.signum(Y[sqa.Findk()])*p (internal program code). Note: many slight variations of the "RokType" already exist, such that it has become difficult to assign them all names.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{3, -4, 4, -3, 1}, {0, 1, 3, 5, 8}, 60] (* Amiram Eldar, Dec 14 2024 *)
  • PARI
    concat(0, Vec(x*(1 + x)*(1 - x + x^2) / ((1 - x)^3*(1 + x^2)) + O(x^40))) \\ Colin Barker, Apr 29 2019

Formula

G.f.: x*(1 + x^3)/((1 + x^2)*(1 - x)^3).
FAMP result: 2*a(n) + 2*A004525(n+1) = A104564(n) + a(n+1).
Superseeker results:
a(2*n+1) = A001844(n) = 2*n*(n+1) + 1 (Centered square numbers);
a(n+1) - a(n) = A098180(n) (Odd numbers with two times the odd numbers repeated in order between them);
a(n) + a(n+2) = A059100(n+1) = A010000(n+1);
a(n+2) - a(n) = A047599(n+1) (Numbers that are congruent to {0, 3, 4, 5} mod 8);
a(n+2) - 2*a(n+1) + a(n) = A007877(n+3) (Period 4 sequence with initial period (0, 1, 2, 1));
Coefficients of g.f.*(1-x)/(1+x) = convolution of this with A280560 gives A004525;
Coefficients of g.f./(1+x) = convolution of this with A033999 gives A054925.
a(n) = (1/2)*(n^2 + 1 - cos(n*Pi/2)). - Ralf Stephan, May 20 2007
From Colin Barker, Apr 29 2019: (Start)
a(n) = (2 - (-i)^n - i^n + 2*n^2) / 4 where i=sqrt(-1).
a(n) = 3*a(n-1) - 4*a(n-2) + 4*a(n-3) - 3*a(n-4) + a(n-5) for n>4. (End)
a(n) = A011848(n-1)+A011848(n+2). - R. J. Mathar, Sep 11 2019
Sum_{n>=1} 1/a(n) = Pi^2/48 + (Pi/2) * tanh(Pi/2) + (Pi/(4*sqrt(2)) * tanh(Pi/(2*sqrt(2)))). - Amiram Eldar, Dec 14 2024

Extensions

Stephan's formula corrected by Bruno Berselli, Apr 29 2019

A305402 A number triangle T(n,k) read by rows for 0<=k<=n, related to the Taylor expansion of f(u, p) = (1/2)*(1+1/(sqrt(1-u^2)))*exp(p*sqrt(1-u^2)).

Original entry on oeis.org

1, 1, -2, 3, -4, 2, 15, -18, 9, -2, 105, -120, 60, -16, 2, 945, -1050, 525, -150, 25, -2, 10395, -11340, 5670, -1680, 315, -36, 2, 135135, -145530, 72765, -22050, 4410, -588, 49, -2, 2027025, -2162160, 1081080, -332640, 69300, -10080, 1008, -64, 2
Offset: 0

Views

Author

Johannes W. Meijer, May 31 2018

Keywords

Comments

The function f(u, p) = (1/2)*(1+1/(sqrt(1-u^2))) * exp(p*sqrt(1-u^2)) was found while studying the Fresnel-Kirchhoff and the Rayleigh-Sommerfeld theories of diffraction, see the Meijer link.
The Taylor expansion of f(u, p) leads to the number triangle T(n, k), see the example section.
Normalization of the triangle terms, dividing the T(n, k) by T(n-k, 0), leads to A084534.
The row sums equal A003436, n >= 2, respectively A231622, n >= 1.

Examples

			The first few terms of the Taylor expansion of f(u; p) are:
f(u, p) = exp(p) * (1 + (1-2*p) * u^2/4 + (3-4*p+2*p^2) * u^4/16 + (15-18*p+9*p^2-2*p^3) * u^6/96 + (105-120*p+60*p^2-16*p^3+2*p^4) * u^8/768 + ... )
The first few rows of the T(n, k) triangle are:
n=0:     1
n=1:     1,     -2
n=2:     3,     -4,    2
n=3:    15,    -18,    9,    -2
n=4:   105,   -120,   60,   -16,   2
n=5:   945,  -1050,  525,  -150,  25,  -2
n=6: 10395, -11340, 5670, -1680, 315, -36, 2
		

References

  • J. W. Goodman, Introduction to Fourier Optics, 1996.
  • A. Papoulis, Systems and Transforms with Applications in Optics, 1968.

Crossrefs

Cf. Related to the left hand columns: A001147, A001193, A261065.
Cf. Related to the right hand columns: A280560, A162395, A006011, A040977, A053347, A054334, A266561.

Programs

  • Magma
    [[n le 0 select 1 else (-1)^k*2^(k-n+1)*Factorial(2*n-k-1)*Binomial(n, k)/Factorial(n-1): k in [0..n]]: n in [1..10]]; // G. C. Greubel, Nov 08 2018
  • Maple
    T := proc(n, k): if n=0 then 1 else (-1)^k*2^(k-n+1)*n*(2*n-k-1)!/(k!*(n-k)!) fi: end: seq(seq(T(n, k), k=0..n), n=0..8);
  • Mathematica
    Table[If[n==0 && k==0,1, (-1)^k*2^(k-n+1)*n*(2*n-k-1)!/(k!*(n-k)!)], {n, 0, 10}, {k,0,n}]//Flatten (* G. C. Greubel, Nov 08 2018 *)
  • PARI
    T(n,k) = {if(n==0, 1, (-1)^k*2^(k-n+1)*n*(2*n-k-1)!/(k!*(n-k)!))}
    for(n=0, 10, for(k=0, n, print1(T(n, k), ", ")); print); \\ Andrew Howroyd, Nov 08 2018
    

Formula

T(n, k) = (-1)^k*2^(k-n+1)*n*(2*n-k-1)!/(k!*(n-k)!), n > 0 and 0 <= k <= n, T(0, 0) = 1.
T(n, k) = (-1)^k*A001147(n-k)*A084534(n, k), n >= 0 and 0 <= k <= n.
T(n, k) = 2^(2*(k-n)+1)*A001147(n-k)*A127674(n, n-k), n > 0 and 0 <= k <= n, T(0, 0) = 1.
T(n, k) = (-1)^k*(A001497(n, k) + A132062(n, k)), n >= 1, T(0,0) = 1.

A280569 a(n) = (-1)^n * 2 if n = 5*k and n!=0, otherwise a(n) = (-1)^n.

Original entry on oeis.org

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

Views

Author

Michael Somos, Jan 05 2017

Keywords

Examples

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

Crossrefs

Cf. A280560.

Programs

  • Magma
    m:=75; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 - x+x^2)*(1-x^3)/(1+x^5))); // G. C. Greubel, Jul 29 2018
  • Mathematica
    a[ n_] := (-1)^n If[ n != 0 && Divisible[n, 5], 2, 1];
    LinearRecurrence[{0,0,0,0,-1},{1,-1,1,-1,1,-2},120] (* or *) PadRight[ {1},120,{2,-1,1,-1,1,-2,1,-1,1,-1}] (* Harvey P. Dale, Jul 18 2021 *)
  • PARI
    {a(n) = (-1)^n * if(n && n%5==0, 2, 1)};
    
  • PARI
    {a(n) = n=abs(n); polcoeff( (1 - x + x^2) * (1 - x^3) / (1 + x^5) + x * O(x^n), n)};
    

Formula

Euler transform of length 10 sequence [-1, 1, 0, 0, -1, -1, 0, 0, 0, 1].
a(n) = -b(n) where b() is multiplicative with b(2^e) = -1 if e>0, b(5^e) = 2 if e>0, b(p^e) = 1 otherwise.
G.f.: (1 - x + x^2) * (1 - x^3) / (1 + x^5).
G.f.: 1 - x / (1 + x) - x^5 / (1 + x^5).
a(n) = a(-n) for all n in Z.
a(5*n) = A280560(n) for all n in Z.

A281727 a(n) = (-1)^n * 2 if n = 3*k and n!=0, otherwise a(n) = (-1)^n.

Original entry on oeis.org

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

Views

Author

Michael Somos, Jan 28 2017

Keywords

Examples

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

Crossrefs

Cf. A280560.

Programs

  • Mathematica
    a[ n_] := {2, -1, 1, -2, 1, -1}[[Mod[n, 6] + 1]] - Boole[n == 0];
    a[ n_] := (-1)^n If[ n != 0 && Divisible[n, 3], 2, 1];
    a[ n_] := SeriesCoefficient[ (1 - x + x^2 - x^3) / (1 + x^3), {x, 0, Abs[n]}];
  • PARI
    {a(n) = (-1)^n * if(n && n%3==0, 2, 1)};
    
  • PARI
    {a(n) = [2, -1, 1, -2, 1, -1][n%6 + 1] - (n==0)};
    
  • PARI
    {a(n) = n=abs(n); polcoeff( (1 - x + x^2 - x^3) / (1 + x^3) + x * O(x^n), n)};

Formula

Euler transform of length 6 sequence [-1, 1, -1, -1, 0, 1].
a(n) = -b(n) where b() is multiplicative with b(2^e) = -1 if e>0, b(3^e) = 2 if e>0, b(p^e) = 1 otherwise.
G.f.: 1 - x / (1 + x) - x^3 / (1 + x^3).
G.f.: (1 - x + x^2 - x^3) / (1 + x^3).
G.f.: (1 - x) * (1 - x^3) * (1 - x^4) / ((1 - x^2) * (1 - x^6)).
a(n) = a(-n) for all n in Z.
a(3*n) = A280560(n) for all n in Z.
Showing 1-8 of 8 results.