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-10 of 22 results. Next

A133872 Period 4: repeat [1, 1, 0, 0].

Original entry on oeis.org

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

Views

Author

Hieronymus Fischer, Oct 10 2007

Keywords

Comments

Partial sums of A056594.
Let i=sqrt(-1) and S(n) = Sum_{k=0..n-1} exp(2*Pi*i*k^2/n) for n>=1 the famous Gauss sum. Then S(n) = (a(n)+a(n+1)*i)*sqrt(n). - Franz Vrabec, Nov 08 2007
a(A042948(n)) = 1; a(A042964(n)) = 0. - Reinhard Zumkeller, Oct 03 2008
a(n) is also the real part of partial sum of powers of the complex unit i. - Enrique Pérez Herrero, Aug 16 2009
Periodic sequences having a period of 2k and composed of k ones followed by k zeros have a closed formula of floor(((n+k) mod 2k)/k). Listed sequences of this form are: k=1..A000035(n+1), k=2..A133872(n), k=3..A088911, k=4..A131078(n), k=5..A112713(n-1). - Gary Detlefs, May 17 2011
0.repeat(0,0,1,1) is 1/5 in base 2, due to 1/5 = (3/16)/(1-1/16). For the general case see 1/A062158(n) in base n >= 2. Here n = 2. - Wolfdieter Lang, Jun 20 2014
a(n) (for n>=1) is the determinant of the n X n Toeplitz matrix M satisfying: M(i,j)=1 if -1<=j-i<=2 and 0 otherwise. - Dmitry Efimov, Jun 23 2015
a(n) (for n>=1) is the difference between numbers of even and odd permutations p of 1,2,...,n such that -1 <= p(i)-i <= 2 for i=1,2,...,n. - Dmitry Efimov, Jan 08 2016
The binomial transform is 1, 2, 3, 4, 6, 12,... (see A038504). - R. J. Mathar, Feb 25 2023

Examples

			G.f. = 1 + x + x^4 + x^5 + x^8 + x^9 + x^12 + x^13 + x^16 + x^17 + x^20 + ...
		

Crossrefs

Programs

Formula

a(n) = (1 + floor(n/2)) mod 2.
a(n) = A004526(A000035(n+2)).
a(n) = 1 + floor(n/2) - 2*floor((n+2)/4).
a(n) = (((n+2) mod 4) - (n mod 2))/2.
a(n) = ((n + 2 - (n mod 2))/2) mod 2.
a(n) = ((2*n + 3 + (-1)^n)/4) mod 2.
a(n) = (1 + (-1)^((2*n - 1 + (-1)^n)/4))/2.
a(n) = binomial(n+2, n) mod 2 = binomial(n+2, 2) mod 2.
a(n) = A000217(n+1) mod 2.
G.f.: (1+x)/(1-x^4) = 1/((1-x)(1+x^2)).
a(n) = 1/2 + (1/2)*cos(Pi*n/2) + (1/2)*sin(Pi*n/2). a(n) = A021913(n+2). - R. J. Mathar, Nov 15 2007
From Jaume Oliver Lafont, Dec 05 2008: (Start)
a(n) = 1/2 + sin((2n+1)Pi/4)/sqrt(2).
a(n) = 1/2 + cos((2n-1)Pi/4)/sqrt(2). (End)
a(n) = Re(Sum_{k=0..n} i^k), where i=sqrt(-1) and Re is the real part of a complex number. a(n) = (1/2)*((Sum_{k=0..n} i^k) + Sum_{k=0..n} i^-k) = Re((1/2)*(1 + i)*(1 - i^(n+1))). - Enrique Pérez Herrero, Aug 16 2009
a(n) = (1 + i^(n*(n-1)))/2, where i=sqrt(-1). - Bruno Berselli, May 18 2011
a(n) = (Sum_{k=1..n} k^j) mod 2, for any j. - Gary Detlefs, Dec 28 2011
a(n) = a(n-1) - a(n-2) + a(n-3) for n>2. - Jean-Christophe Hervé, May 01 2013
a(n) = 1 - floor(n/2) + 2*floor(n/4) = 1 - A004526(n) + A122461(n). - Wesley Ivan Hurt, Dec 06 2013
a(n) = (1 + (-1)^floor(n/2))/2. - Wesley Ivan Hurt, Apr 17 2014
a(n) = A054925(n+2) - A011848(n+2). - Wesley Ivan Hurt, Jun 09 2014
Euler transform of length 4 sequence [1, -1, 0, 1]. - Michael Somos, Sep 26 2014
a(n) = a(1-n) for all n in Z. - Michael Somos, Sep 26 2014
From Ilya Gutkovskiy, Jul 09 2016: (Start)
Inverse binomial transform of A038504(n+1).
E.g.f.: (exp(x) + sin(x) + cos(x))/2. (End)
a(n) = (1 + (-1)^(n*(n-1)/2))/2. - Guenther Schrack, Apr 04 2019

Extensions

Definition rewritten by N. J. A. Sloane, Apr 30 2009

A052551 Expansion of 1/((1 - x)*(1 - 2*x^2)).

Original entry on oeis.org

1, 1, 3, 3, 7, 7, 15, 15, 31, 31, 63, 63, 127, 127, 255, 255, 511, 511, 1023, 1023, 2047, 2047, 4095, 4095, 8191, 8191, 16383, 16383, 32767, 32767, 65535, 65535, 131071, 131071, 262143, 262143, 524287, 524287, 1048575, 1048575, 2097151, 2097151
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

Equals row sums of triangle A137865. - Gary W. Adamson, Feb 18 2008
Also, the decimal representation of the diagonal from the corner to the origin of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 566", based on the 5-celled von Neumann neighborhood, initialized with a single black (ON) cell at stage zero. - Robert Price, Jul 05 2017
Number of nonempty subsets of {1,2,...,n+1} that contain only odd numbers. a(0) = a(1) = 1: {1}; a(6) = a(7) = 15: {1}, {3}, {5}, {7}, {1,3}, {1,5}, {1,7}, {3,5}, {3,7}, {5,7}, {1,3,5}, {1,3,7}, {1,5,7}, {3,5,7}, {1,3,5,7}. - Enrique Navarrete, Mar 16 2018
Number of nonempty subsets of {1,2,...,n+2} that contain only even numbers. a(0) = a(1) = 1: {2}; a(4) = a(5) = 7: {2}, {4}, {6}, {2,4}, {2,6}, {4,6}, {2,4,6}. - Enrique Navarrete, Mar 26 2018
Doubling of A000225(n+1), n >= 0 entries. First differences give A077957. - Wolfdieter Lang, Apr 08 2018
a(n-2) is the number of achiral rows or cycles of length n partitioned into two sets or the number of color patterns using exactly 2 colors. An achiral row or cycle is equivalent to its reverse. Two color patterns are equivalent if the colors are permuted. For n = 4, the a(n-2) = 3 row patterns are AABB, ABAB, and ABBA; the cycle patterns are AAAB, AABB, and ABAB. For n = 5, the a(n-2) = 3 patterns for both rows and cycles are AABAA, ABABA, and ABBBA. For n = 6, the a(n-2) = 7 patterns for rows are AAABBB, AABABB, AABBAA, ABAABA, ABABAB, ABBAAB, and ABBBBA; the cycle patterns are AAAAAB, AAAABB, AAABAB, AAABBB, AABAAB, AABABB, and ABABAB. - Robert A. Russell, Oct 15 2018
For integers m > 1, the expansion of 1/((1 - x)*(1 - m*x^2)) generates a(n) = (sqrt(m)^(n + 1)*((-1)^n*(sqrt(m) - 1) + sqrt(m) + 1) - 2)/(2*(m - 1)). It appears, for integer values of n >= 0 and m > 1, that it could be simplified in the integral domain a(n) = (m^(1 + floor(n/2)) - 1)/(m - 1). - Federico Provvedi, Nov 23 2018
From Werner Schulte, Mar 04 2019: (Start)
More generally: For some fixed integers q and r > 0 the expansion of A(q,r; x) = 1/((1-x)*(1-q*x^r)) generates coefficients a(q,r; n) = (q^(1+floor(n/r))-1)/(q-1) for n >= 0; the special case q = 1 leads to a(1,r; n) = 1 + floor(n/r).
The a(q,r; n) satisfy for n > r a linear recurrence equation with constant coefficients. The signature vector is given by the sum of two vectors v and w where v has terms 1 followed by r zeros, i.e., (1,0,0,...,0), and w has r-1 leading zeros followed by q and -q, i.e., (0,0,...,0,q,-q).
Let a_i(q,r; n) be the convolution inverse of a(q,r; n). The terms are given by the sum a_i(q,r; n) = b(n) + c(n) for n >= 0 where b(n) has terms 1 and -1 followed by infinitely zeros, i.e., (1,-1,0,0,0,...), and c(n) has r leading zeros followed by -q, q and infinitely zeros, i.e., (0,0,...,0,-q,q,0,0,0,...).
Here is an example for q = 3 and r = 5: The expansion of A(3,5; x) = 1/((1-x)*(1-3*x^5)) = Sum_{n>=0} a(3,5; n)*x^n generates the sequence of coefficients (a(3,5; n)) = (1,1,1,1,1,4,4,4,4,4,13,13,13,13,13,40,...) where r = 5 controls the repetition and q = 3 the different values.
The a(3,5; n) satisfy for n > 5 the linear recurrence equation with constant coefficients and signature (1,0,0,0,0,0) + (0,0,0,0,3,-3) = (1,0,0,0,3,-3).
The convolution inverse a_i(3,5; n) has terms (1,-1,0,0,0,0,0,0,0,...) + (0,0,0,0,0,-3,3,0,0,...) = (1,-1,0,0,0,-3,3,0,0,...).
For further examples and informations see A014983 (q,r = -3,1), A077925 (q,r = -2,1), A000035 (q,r = -1,1), A000012 (q,r = 0,1), A000027 (q,r = 1,1), A000225 (q,r = 2,1), A003462 (q,r = 3,1), A077953 (q,r = -2,2), A133872 (q,r = -1,2), A004526 (q,r = 1,2), A052551 (this sequence with q,r = 2,2), A077886 (q,r = -2,3), A088911 (q,r = -1,3), A002264 (q,r = 1,3) and A077885 (q,r = 2,3). The offsets might be different.
(End)
a(n) is the number of palindromes of length n over the alphabet {1,2} containing the letter 1. More generally, the number of palindromes of length n over the alphabet {1,2,...,k} containing the letter 1 is given by k^ceiling(n/2)-(k-1)^ceiling(n/2). - Sela Fried, Dec 10 2024

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Column 2 (offset by two) of A304972.
Cf. A000225 (oriented), A056326 (unoriented), and A122746(n-2) (chiral) for rows.
Cf. A056295 (oriented), A056357 (unoriented), and A059053 (chiral) for cycles.

Programs

  • GAP
    Flat(List([1..21],n->[2^n-1,2^n-1])); # Muniru A Asiru, Oct 16 2018
    
  • Magma
    [2^Floor(n/2)-1: n in [2..50]]; // Vincenzo Librandi, Aug 16 2011
    
  • Maple
    spec := [S,{S=Prod(Sequence(Prod(Z,Union(Z,Z))),Sequence(Z))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..20);
  • Mathematica
    Table[StirlingS2[Floor[n/2] + 2, 2], {n, 0, 50}] (* Robert A. Russell, Dec 20 2017 *)
    Drop[LinearRecurrence[{1, 2, -2}, {0, 1, 1}, 50], 1] (* Robert A. Russell, Oct 14 2018 *)
    CoefficientList[Series[1/((1-x)*(1-2*x^2)), {x, 0, 50}], x] (* Stefano Spezia, Oct 16 2018 *)
    2^(1+Floor[(Range[0,50])/2])-1 (* Federico Provvedi, Nov 22 2018 *)
    ((-1)^#(Sqrt[2]-1)+Sqrt[2]+1)2^((#-1)/2)-1&@Range[0, 50] (* Federico Provvedi, Nov 23 2018 *)
  • PARI
    x='x+O('x^50); Vec(1/((1-x)*(1-2*x^2))) \\ Altug Alkan, Mar 19 2018
    
  • Sage
    [2^(floor(n/2)) -1 for n in (2..50)] # G. C. Greubel, Mar 04 2019

Formula

G.f.: 1/((1 - x)*(1 - 2*x^2)).
Recurrence: a(1) = 1, a(0) = 1, -2*a(n) - 1 + a(n+2) = 0.
a(n) = -1 + Sum((1/2)*(1 + 2*alpha)*alpha^(-1 - n)) where the sum is over alpha = the two roots of -1 + 2*x^2.
a(n) = A016116(n+2) - 1. - R. J. Mathar, Jun 15 2009
a(n) = A060546(n+1) - 1. - Filip Zaludek, Dec 10 2016
From Robert A. Russell, Oct 15 2018: (Start)
a(n-2) = S2(floor(n/2)+1,2), where S2 is the Stirling subset number A008277.
a(n-2) = 2*A056326(n) - A000225(n) = A000225(n) - 2*A122746(n-2) = A056326(n) - A122746(n-2).
a(n-2) = 2*A056357(n) - A056295(n) = A056295(n) - 2*A059053(n) = A056357(n) - A059053(n). (End)
From Federico Provvedi, Nov 22 2018: (Start)
a(n) = 2^( 1 + floor(n/2) ) - 1.
a(n) = ( (-1)^n*(sqrt(2)-1) + sqrt(2) + 1 ) * 2^( (n - 1)/2 ) - 1. (End)
E.g.f.: 2*cosh(sqrt(2)*x) + sqrt(2)*sinh(sqrt(2)*x) - cosh(x) - sinh(x). - Franck Maminirina Ramaharo, Nov 23 2018

Extensions

More terms from James Sellers, Jun 06 2000

A124419 Number of partitions of the set {1,2,...n} having no blocks that contain both odd and even entries.

Original entry on oeis.org

1, 1, 1, 2, 4, 10, 25, 75, 225, 780, 2704, 10556, 41209, 178031, 769129, 3630780, 17139600, 87548580, 447195609, 2452523325, 13450200625, 78697155750, 460457244900, 2859220516290, 17754399678409, 116482516809889, 764214897046969, 5277304280371714
Offset: 0

Views

Author

Emeric Deutsch, Oct 31 2006

Keywords

Examples

			a(4) = 4 because we have 13|24, 1|24|3, 13|2|4 and 1|2|3|4.
		

Crossrefs

Column k=0 of A124418 and of A363493.
Column k=2 of A275069.

Programs

  • Maple
    Q[0]:=1: for n from 1 to 30 do if n mod 2 = 1 then Q[n]:=expand(t*diff(Q[n-1],t)+x*diff(Q[n-1],s)+x*diff(Q[n-1],x)+t*Q[n-1]) else Q[n]:=expand(x*diff(Q[n-1],t)+s*diff(Q[n-1],s)+x*diff(Q[n-1],x)+s*Q[n-1]) fi od: for n from 0 to 30 do Q[n]:=Q[n] od: seq(subs({t=1,s=1,x=0},Q[n]),n=0..30);
    # second Maple program:
    with(combinat):
    a:= n-> bell(floor(n/2))*bell(ceil(n/2)):
    seq(a(n), n=0..30);  # Alois P. Heinz, Oct 23 2013
  • Mathematica
    a[n_] := BellB[Floor[n/2]]*BellB[Ceiling[n/2]]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 20 2015, after Alois P. Heinz *)

Formula

a(n) = Q[n](1,1,0), where the polynomials Q[n]=Q[n](t,s,x) are defined by Q[0]=1; Q[n]=t*dQ[n-1]/dt + x*dQ[n-1]/ds + x*dQ[n-1]/dx + t*Q[n-1] if n is odd and Q[n]=x*dQ[n-1]/dt + s*dQ[n-1]/ds + x*dQ[n-1]/dx + s*Q[n-1] if n is even.
a(n) = A000110(floor(n/2)) * A000110(ceiling(n/2)). - Alois P. Heinz, Oct 23 2013
a(n) mod 2 = A088911(n). - Alois P. Heinz, Jun 06 2023

A129339 Main diagonal of triangular array T: T(j,1) = 1 for ((j-1) mod 6) < 3, else 0; T(j,k) = T(j-1,k-1) + T(j,k-1) for 2 <= k <= j.

Original entry on oeis.org

1, 2, 4, 7, 11, 16, 23, 37, 74, 175, 431, 1024, 2291, 4825, 9650, 18571, 34955, 65536, 124511, 242461, 484922, 989527, 2038103, 4194304, 8565755, 17308657, 34617314, 68703187, 135812051, 268435456, 532087943, 1059392917, 2118785834
Offset: 1

Views

Author

Paul Curtz, May 28 2007

Keywords

Examples

			First seven rows of T are
[ 1 ]
[ 1,  2 ]
[ 1,  2,  4 ]
[ 0,  1,  3,  7 ]
[ 0,  0,  1,  4, 11 ]
[ 0,  0,  0,  1,  5, 16 ]
[ 1,  1,  1,  1,  2,  7, 23 ].
		

Crossrefs

Cf. A038504, A131022 (T read by rows), A131023 (first subdiagonal of T), A131024 (row sums of T), A131025 (antidiagonal sums of T). First through sixth column of T are in A088911, A131026, A131027, A131028, A131029, A131030 resp.

Programs

  • Magma
    m:=33; M:=ZeroMatrix(IntegerRing(), m, m); for j:=1 to m do if (j-1) mod 6 lt 3 then M[j, 1]:=1; end if; end for; for k:=2 to m do for j:=k to m do M[j, k]:=M[j-1, k-1]+M[j, k-1]; end for; end for; [ M[n, n]: n in [1..m] ]; // Klaus Brockhaus, Jun 10 2007
    
  • Magma
    m:=33; S:=[ [1, 1, 1, 0, 0, 0][(n-1) mod 6 + 1]: n in [1..m] ]; [ &+[ Binomial(i-1, k-1)*S[k]: k in [1..i] ]: i in [1..m] ]; // Klaus Brockhaus, Jun 17 2007
    
  • Magma
    I:=[1,2,4,7]; [n le 4 select I[n] else 5*Self(n-1)-9*Self(n-2)+6*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Feb 13 2018
  • Mathematica
    a[n_] := 2^(n-2) + 2*3^((n-3)/2)*Sin[n*Pi/6]; a[1]=1; Table[a[n], {n, 1, 33}] (* Jean-François Alcover, Aug 13 2012 *)
    CoefficientList[Series[(1 - x)^3 / ((1 - 2 x) (1 - 3 x + 3 x^2)), {x, 0, 33}], x] (* Vincenzo Librandi, Feb 13 2018 *)
  • PARI
    {m=33; v=concat([1, 2, 4, 7], vector(m-4)); for(n=5, m, v[n]=5*v[n-1]-9*v[n-2]+6*v[n-3]); v} \\ Klaus Brockhaus, Jun 10 2007
    

Formula

G.f.: x*(1-x)^3/((1-2*x)*(1-3*x+3*x^2)). [multiplied by x to match the offset by R. J. Mathar, Jul 22 2009]
a(1) = 1, a(2) = 2, a(3) = 4, a(4) = 7; for n > 4, a(n) = 5*a(n-1) - 9*a(n-2) + 6*a(n-3).
Binomial transform of A088911. - Klaus Brockhaus, Jun 17 2007
a(n+1) = A057083(n)/3+2^(n-1), n > 1. - R. J. Mathar, Jul 22 2009

Extensions

Edited and extended by Klaus Brockhaus, Jun 10 2007

A131026 Periodic sequence (2, 2, 1, 0, 0, 1).

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, following a suggestion of Paul Curtz, Jun 10 2007

Keywords

Comments

Second column of triangular array T defined in A131022.

Crossrefs

Cf. A131022, A021823. Other columns of T are in A088911, A131027, A131028, A131029, A131030.

Programs

  • Magma
    m:=105; [ [2, 2, 1, 0, 0, 1][(n-1) mod 6 + 1]: n in [1..m] ];
  • Mathematica
    PadRight[{},120,{2,2,1,0,0,1}] (* or *) LinearRecurrence[{2,-2,1},{2,2,1},120] (* Harvey P. Dale, Jul 16 2012 *)
  • PARI
    {m=105; for(n=1, m, r=(n-1)%6; print1(if(r<2, 2, if(r==2||r==5, 1, 0)), ","))}
    

Formula

a(1) = a(2) = 2, a(3) = 1, a(4) = a(5) = 0, a(6) = 1; for n > 6, a(n) = a(n-6).
G.f.: (2-2*x+x^2)/((1-x)*(1-x+x^2)).
a(n) = A021823(n+2).
a(n) = floor(((n+3) mod 6)/4)+floor(((n+2) mod 3)/2). - Gary Detlefs, Oct 02 2013
a(n) = 1+2/sqrt(3)*sin(Pi/3*n). - Werner Schulte, Jul 21 2017

A131027 Period 6: repeat [4, 3, 1, 0, 1, 3].

Original entry on oeis.org

4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1, 0, 1, 3, 4, 3, 1
Offset: 1

Views

Author

Klaus Brockhaus, following a suggestion of Paul Curtz, Jun 10 2007

Keywords

Comments

Third column of triangular array T defined in A131022.
a(n) = abs(A078070(n+1)).
Determinants of the spiral knots S(3,k,(1,1)). a(k+4) = det(S(3,k,(1,1))). These knots are also the torus knots T(3,k). - Ryan Stees, Dec 13 2014

Examples

			For k=3, b(7)=sqrt(3)b(6)-b(5)=3-1=2, so det(S(3,3,(1,1)))=2^2=4.
		

Crossrefs

Cf. A087204, A131022, A078070. Other columns of T are in A088911, A131026, A131028, A131029, A131030.

Programs

  • Magma
    m:=105; [ [4, 3, 1, 0, 1, 3][(n-1) mod 6 + 1]: n in [1..m] ];
    
  • Maple
    A131027:=n->2+cos(n*Pi/3)+sqrt(3)*sin(n*Pi/3): seq(A131027(n), n=1..100); # Wesley Ivan Hurt, Sep 11 2014
  • Mathematica
    Table[2 + Cos[n*Pi/3] + Sqrt[3]*Sin[n*Pi/3], {n, 30}] (* Wesley Ivan Hurt, Sep 11 2014 *)
  • PARI
    {m=105; for(n=1, m, r=(n-1)%6; print1(if(r==0, 4, if(r==1||r==5, 3, if(r==3, 0, 1))), ","))}
    
  • Sage
    [(lucas_number2(n,2,1)-lucas_number2(n-1,1,1)) for n in range(4, 109)] # Zerinvary Lajos, Nov 10 2009

Formula

a(1) = 4, a(2) = a(6) = 3, a(3) = a(5) = 1, a(4) = 0, a(6) = 1; for n > 6, a(n) = a(n-6).
G.f.: (4-5*x+3*x^2)/((1-x)*(1-x+x^2)).
a(n) = 2+cos(n*Pi/3)+sqrt(3)*sin(n*Pi/3) = 2+(-1)^((n-1)/3)+(-1)^((1-n)/3). - Wesley Ivan Hurt, Sep 11 2014
a(k+4) = det(S(3,k,(1,1))) = (b(k+4))^2, where b(5)=1, b(6)=sqrt(3), b(k)=sqrt(3)*b(k-1) - b(k-2) = b(6)*b(k-1) - b(k-2). - Ryan Stees, Dec 13 2014
a(n) = 2 + 2*cos(Pi/3*(n-1)) = 2 + A087204(n-1) for n >= 1. - Werner Schulte, Jul 18 2017 and Peter Munn, Apr 28 2022

A131022 Triangular array T read by rows: T(j,1) = 1 for ((j-1) mod 6) < 3, else 0; T(j,k) = T(j-1,k-1) + T(j,k-1) for 2 <= k <= j.

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 0, 1, 3, 7, 0, 0, 1, 4, 11, 0, 0, 0, 1, 5, 16, 1, 1, 1, 1, 2, 7, 23, 1, 2, 3, 4, 5, 7, 14, 37, 1, 2, 4, 7, 11, 16, 23, 37, 74, 0, 1, 3, 7, 14, 25, 41, 64, 101, 175, 0, 0, 1, 4, 11, 25, 50, 91, 155, 256, 431, 0, 0, 0, 1, 5, 16, 41, 91, 182, 337, 593, 1024
Offset: 1

Views

Author

Klaus Brockhaus, following a suggestion of Paul Curtz, Jun 10 2007

Keywords

Comments

All columns are periodic with period length 6. The (3+6*i)-th row equals the first (3+6*i) terms of main diagonal (i >= 0).

Examples

			First seven rows of T are
[ 1 ]
[ 1, 2 ]
[ 1, 2, 4 ]
[ 0, 1, 3, 7 ]
[ 0, 0, 1, 4, 11 ]
[ 0, 0, 0, 1, 5, 16 ]
[ 1, 1, 1, 1, 2, 7, 23 ].
		

Crossrefs

Cf. A129339 (main diagonal of T), A131023 (first subdiagonal of T), A131024 (row sums of T), A131025 (antidiagonal sums of T). First through sixth column of T are in A088911, A131026, A131027, A131028, A131029, A131030 resp.

Programs

  • Magma
    m:=13; M:=ZeroMatrix(IntegerRing(), m, m); for j:=1 to m do if (j-1) mod 6 lt 3 then M[j, 1]:=1; end if; end for; for k:=2 to m do for j:=k to m do M[j, k]:=M[j-1, k-1]+M[j, k-1]; end for; end for; &cat[ [ M[j, k]: k in [1..j] ]: j in [1..m] ];
  • Mathematica
    T[j_, 1] := If[Mod[j-1, 6]<3, 1, 0]; T[j_, k_] := T[j, k] = T[j-1, k-1]+T[j, k-1]; Table[T[j, k], {j, 1, 13}, {k, 1, j}] // Flatten (* Jean-François Alcover, Mar 06 2014 *)
  • PARI
    {m=13; M=matrix(m, m); for(j=1, m, M[j, 1]=if((j-1)%6<3, 1, 0)); for(k=2, m, for(j=k, m, M[j, k]=M[j-1, k-1]+M[j, k-1])); for(j=1, m, for(k=1, j, print1(M[j, k], ",")))}
    

Formula

From Werner Schulte, Jul 22 2017: (Start)
T(n,k) = 2^(k-2) + 2*sqrt(3)^(k-3) * sin(Pi/6*(2*n-k)) for 1 < k <= n, and
T(n,1) = 1 - floor((n-1)/3) mod 2 for n >= 1. (End)

A131078 Periodic sequence (1, 1, 1, 1, 0, 0, 0, 0).

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, following a suggestion of Paul Curtz, Jun 14 2007

Keywords

Crossrefs

Period 2*k: repeat k ones followed by k zeros: A000035(n+1) (k=1), A133872(n) (k=2), A088911 (k=3), this sequence (k=4), and A112713(n-1) (k=5).

Programs

  • Magma
    m:=105; [ [1, 1, 1, 1, 0, 0, 0, 0][ (n-1) mod 8 + 1 ]: n in [1..m] ];
    
  • Magma
    &cat[[1, 1, 1, 1, 0, 0, 0,0]: n in [0..10]]; // Vincenzo Librandi, May 31 2015
    
  • Magma
    [Floor((1+(-1)^((2*n+11-(-1)^n+2*(-1)^((2*n+5-(-1)^n)/4))/8))/2): n in [1..60]]; // Vincenzo Librandi, May 31 2015
    
  • PARI
    {m=105; for(n=1, m, print1((n-1)%8<4, ","))}
    
  • Python
    def A131078(n): return int(not n-1&4) # Chai Wah Wu, Jan 31 2023

Formula

a(1) = a(2) = a(3) = a(4) = 1, a(5) = a(6) = a(7) = a(8) = 0; for n > 8, a(n) = a(n-8).
G.f.: x/((1-x)*(1+x^4)).
a(n) = floor(((n+4) mod 8)/4). [Gary Detlefs, May 17 2011]
From Wesley Ivan Hurt, May 30 2015: (Start)
a(n) = a(n-1)-a(n-4)+a(n-5), n>5.
a(n) = (1+(-1)^((2*n+11-(-1)^n+2*(-1)^((2*n+5-(-1)^n)/4))/8))/2. (End)
From Ridouane Oudra, Nov 17 2019: (Start)
a(n) = binomial(n+3,4) mod 2
a(n) = floor((n+3)/4) - 2*floor((n+3)/8). (End)

A131028 Periodic sequence (7, 4, 1, 1, 4, 7).

Original entry on oeis.org

7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 7, 4, 1
Offset: 1

Views

Author

Klaus Brockhaus, following a suggestion of Paul Curtz, Jun 10 2007

Keywords

Comments

Fourth column of triangular array T defined in A131022.
Continued fractions of (131 + sqrt(18530))/37 = 7.2195930... - R. J. Mathar, Mar 08 2012

Crossrefs

Cf. A131022, A084104. Other columns of T are in A088911, A131026, A131027, A131029, A131030.

Programs

  • Magma
    m:=105; [ [7, 4, 1, 1, 4, 7][(n-1) mod 6 + 1]: n in [1..m] ];
  • Mathematica
    PadRight[{},120,{7,4,1,1,4,7}] (* Harvey P. Dale, Jul 15 2013 *)
  • PARI
    {m=105; for(n=1, m, r=(n-1)%6; print1(if(r==0||r==5, 7, if(r==1||r==4, 4, 1)), ","))}
    

Formula

a(1) = a(6) = 7, a(2) = a(5) = 4, a(3) = a(4) = 1; for n > 6, a(n) = a(n-6).
G.f.: x*(7-10*x+7*x^2)/((1-x)*(1-x+x^2)).
a(n) = A084104(n+2).
a(n) = 4+2*sqrt(3)*cos(Pi/6*(2*n-1)). - Werner Schulte, Jul 21 2017

A131029 Periodic sequence (11, 5, 2, 5, 11, 14).

Original entry on oeis.org

11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14, 11, 5, 2, 5, 11, 14
Offset: 1

Views

Author

Klaus Brockhaus, following a suggestion of Paul Curtz, Jun 10 2007

Keywords

Comments

Fifth column of triangular array T defined in A131022.

Crossrefs

Cf. A131022. Other columns of T are in A088911, A131026, A131027, A131028, A131030.

Programs

  • Magma
    m:=84; [ [11, 5, 2, 5, 11, 14][(n-1) mod 6 + 1]: n in [1..m] ];
    
  • Mathematica
    PadRight[{},120,{11,5,2,5,11,14}] (* or *) LinearRecurrence[{2,-2,1},{11,5,2},120] (* Harvey P. Dale, Jun 12 2017 *)
  • PARI
    {m=84; for(n=1, m, r=(n-1)%6; print1(if(r==0||r==4, 11, if(r==2, 2, if(r==5, 14, 5))), ","))}
    
  • Python
    def a(n): return [11, 5, 2, 5, 11, 14][n%6]
    print([a(n) for n in range(84)]) # Michael S. Branicky, Nov 05 2021

Formula

a(1) = a(5) = 11, a(2) = a(4) = 5, a(3) = 2, a(6) = 14; for n > 6, a(n) = a(n-6).
G.f.: (11-17*x+14*x^2)/((1-x)*(1-x+x^2)).
a(n) = 3*cos((n-1)/3*Pi)-3*sqrt(3)*sin((n-1)/3*Pi)+8. - Leonid Bedratyuk, May 13 2012
Showing 1-10 of 22 results. Next