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

A028242 Follow n+1 by n. Also (essentially) Molien series of 2-dimensional quaternion group Q_8.

Original entry on oeis.org

1, 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12, 11, 13, 12, 14, 13, 15, 14, 16, 15, 17, 16, 18, 17, 19, 18, 20, 19, 21, 20, 22, 21, 23, 22, 24, 23, 25, 24, 26, 25, 27, 26, 28, 27, 29, 28, 30, 29, 31, 30, 32, 31, 33, 32, 34, 33, 35, 34, 36, 35, 37, 36, 38
Offset: 0

Views

Author

Keywords

Comments

A two-way infinite sequences which is palindromic (up to sign). - Michael Somos, Mar 21 2003
Number of permutations of [n+1] avoiding the patterns 123, 132 and 231 and having exactly one fixed point. Example: a(0) because we have 1; a(2)=2 because we have 213 and 321; a(3)=1 because we have 3214. - Emeric Deutsch, Nov 17 2005
The ring of invariants for the standard action of Quaternions on C^2 is generated by x^4 + y^4, x^2 * y^2, and x * y * (x^4 - y^4). - Michael Somos, Mar 14 2011
A000027 and A001477 interleaved. - Omar E. Pol, Feb 06 2012
First differences are A168361, extended by an initial -1. (Or: a(n)-a(n-1) = A168361(n+1), for all n >= 1.) - M. F. Hasler, Oct 05 2017
Also the number of unlabeled simple graphs with n + 1 vertices and exactly n endpoints (vertices of degree 1). The labeled version is A327370. - Gus Wiseman, Sep 06 2019

Examples

			G.f. = 1 + 2*x^2 + x^3 + 3*x^4 + 2*x^5 + 4*x^6 + 3*x^7 + 5*x^8 + 4*x^9 + 6*x^10 + 5*x^11 + ...
Molien g.f. = 1 + 2*t^4 + t^6 + 3*t^8 + 2*t^10 + 4*t^12 + 3*t^14 + 5*t^16 + 4*t^18 + 6*t^20 + ...
		

References

  • D. Benson, Polynomial Invariants of Finite Groups, Cambridge, p. 23.
  • S. Mukai, An Introduction to Invariants and Moduli, Cambridge, 2003; see p. 15.
  • M. D. Neusel and L. Smith, Invariant Theory of Finite Groups, Amer. Math. Soc., 2002; see p. 97.
  • L. Smith, Polynomial Invariants of Finite Groups, A K Peters, 1995, p. 90.

Crossrefs

Cf. A000124 (a=1, a=n+a), A028242 (a=1, a=n-a).
Partial sums give A004652. A030451(n)=a(n+1), n>0.
Cf. A052938 (same sequence except no leading 1,0,2).
Column k = n - 1 of A327371.

Programs

  • GAP
    a:=[1];; for n in [2..80] do a[n]:=(n-1)-a[n-1]; od; a; # Muniru A Asiru, Dec 16 2018
    
  • Haskell
    import Data.List (transpose)
    a028242 n = n' + 1 - m where (n',m) = divMod n 2
    a028242_list = concat $ transpose [a000027_list, a001477_list]
    -- Reinhard Zumkeller, Nov 27 2012
    
  • Magma
    &cat[ [n+1, n]: n in [0..37] ]; // Klaus Brockhaus, Nov 23 2009
    
  • Maple
    series((1+x^3)/(1-x^2)^2,x,80);
    A028242:=n->floor((n+1+(-1)^n)/2): seq(A028242(n), n=0..100); # Wesley Ivan Hurt, Mar 17 2015
  • Mathematica
    Table[(1 + 2 n + 3 (-1)^n)/4, {n, 0, 74}] (* or *)
    LinearRecurrence[{1, 1, -1}, {1, 0, 2}, 75] (* or *)
    CoefficientList[Series[(1 - x + x^2)/((1 - x) (1 - x^2)), {x, 0, 74}], x] (* Michael De Vlieger, May 21 2017 *)
    Table[{n,n-1},{n,40}]//Flatten (* Harvey P. Dale, Jun 26 2017 *)
    Table[3*floor(n/2)-n+1,{n,0,40}] (* Pierre-Alain Sallard, Dec 15 2018 *)
  • PARI
    {a(n) = (n\2) - (n%2) + 1} \\ Michael Somos, Oct 02 1999
    
  • PARI
    A028242(n)=n\2+!bittest(n,0) \\ M. F. Hasler, Oct 05 2017
    
  • Sage
    s=((1+x^3)/(1-x^2)^2).series(x, 80); s.coefficients(x, sparse=False) # G. C. Greubel, Dec 16 2018

Formula

Expansion of the Molien series for standard action of Quaternions on C^2: (1 + t^6) / (1 - t^4)^2 = (1 - t^12) / ((1 - t^4)^2 * (1 - t^6)) in powers of t^2.
Euler transform of length 6 sequence [0, 2, 1, 0, 0, -1]. - Michael Somos, Mar 14 2011
a(n) = n - a(n-1) [with a(0) = 1] = A000035(n-1) + A004526(n). - Henry Bottomley, Jul 25 2001
G.f.: (1 - x + x^2) / ((1 - x) * (1 - x^2)) = ( 1+x^2-x ) / ( (1+x)*(x-1)^2 ).
a(2*n) = n + 1, a(2*n + 1) = n, a(-1 - n) = -a(n).
a(n) = a(n - 1) + a(n - 2) - a(n - 3).
a(n) = floor(n/2) + 1 - n mod 2. a(2*k) = k+1, a(2*k+1) = k; A110657(n) = a(a(n)), A110658(n) = a(a(a(n))); a(n) = A109613(n)-A110654(n) = A110660(n)/A110654(n). - Reinhard Zumkeller, Aug 05 2005
a(n) = 2*floor(n/2) - floor((n-1)/2). - Wesley Ivan Hurt, Oct 22 2013
a(n) = floor((n+1+(-1)^n)/2). - Wesley Ivan Hurt, Mar 15 2015
a(n) = (1 + 2n + 3(-1)^n)/4. - Wesley Ivan Hurt, Mar 18 2015
a(n) = Sum_{i=1..floor(n/2)} floor(n/(n-i)) for n > 0. - Wesley Ivan Hurt, May 21 2017
a(2n) = n+1, a(2n+1) = n, for all n >= 0. - M. F. Hasler, Oct 05 2017
a(n) = 3*floor(n/2) - n + 1. - Pierre-Alain Sallard, Dec 15 2018
E.g.f.: ((2 + x)*cosh(x) + (x - 1)*sinh(x))/2. - Stefano Spezia, Aug 01 2022
Sum_{n>=2} (-1)^(n+1)/a(n) = 1. - Amiram Eldar, Oct 04 2022

Extensions

First part of definition adjusted to match offset by Klaus Brockhaus, Nov 23 2009

A033638 Quarter-squares plus 1 (that is, a(n) = A002620(n) + 1).

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 10, 13, 17, 21, 26, 31, 37, 43, 50, 57, 65, 73, 82, 91, 101, 111, 122, 133, 145, 157, 170, 183, 197, 211, 226, 241, 257, 273, 290, 307, 325, 343, 362, 381, 401, 421, 442, 463, 485, 507, 530, 553, 577, 601, 626, 651, 677, 703, 730, 757, 785, 813, 842
Offset: 0

Views

Author

Tanya Y. Berger-Wolf (tanyabw(AT)uiuc.edu)

Keywords

Comments

Fill an infinity X infinity matrix with numbers so that 1..n^2 appear in the top left n X n corner for all n; write down the minimal elements in the rows and columns and sort into increasing order; maximize this list in the lexicographic order.
From Donald S. McDonald, Jan 09 2003: (Start)
Numbers of the form n^2 + 1 or n^2 + n + 1.
Locations of right angle turns in Ulam square spiral. (End)
a(n-1) (for n >= 1) is also the number u of unique Fibonacci/Lucas type sequences generated (the total number t of these sequences being a triangular number). Sum(n+1)=t. Then u=Sum((n+1/2) minus 0.5 for odd terms) except for the initial term. E.g., u=13: (n=6)+1 = 7; then 7/2 - 0.5 =3. So u = Sum(1, 1, 1, 2, 2, 3, 3) = 13. - Marco Matosic, Mar 11 2003
Number of (3412,123)-avoiding involutions in S_n.
Schur's Theorem (1905): the maximum number of mutually commuting linearly independent complex matrices of order n is floor((n^2)/4) + 1. - Jonathan Vos Post, Apr 03 2007
Let A be the Hessenberg n X n matrix defined by: A[1,j]=j mod 2, A[i,i]:=1, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n >= 1, a(n)=(-1)^(n-1)*coeff(charpoly(A,x),x). - Milan Janjic, Jan 24 2010
Except for the initial two terms, A033638 gives iterates of the nonsquare function: c(n) = f(c(n-1)), where f(n) = A000037(n) = n + floor(1/2 + sqrt(n)) = n-th nonsquare, starting with c(1)=2. - Clark Kimberling, Dec 28 2010
For n >= 1: for all permutations of [0..n-1]: number of distinct values taken by Sum_{k=0..n-1} (k mod 2) * pi(k). - Joerg Arndt, Apr 22 2011
First differences are A110654. - Jon Perry, Sep 12 2012
Number of (weakly) unimodal compositions of n with maximal part <= 2, see example. - Joerg Arndt, May 10 2013
Construct an infinite triangular matrix with 1's in the leftmost column and the natural numbers in all other columns but shifted down twice. Square the triangle and the sequence is the leftmost column vector. - Gary W. Adamson, Jan 27 2014
Equals the sum of terms in upward sloping diagonals of an infinite lower triangle with 1's in the leftmost column and the natural numbers in all other columns. - Gary W. Adamson, Jan 29 2014
a(n) is the number of permutations of length n avoiding both 213 and 321 in the classical sense which are breadth-first search reading words of increasing unary-binary trees. For more details, see the entry for permutations avoiding 231 at A245898. - Manda Riehl, Aug 05 2014
Number of partitions of n with no more than 2 parts > 1. - Wouter Meeussen, Feb 22 2015, revised Apr 24 2023
Number of possible values for the area of a polyomino whose perimeter is 2n + 4. - Luc Rousseau, May 10 2018
a(n) is the number of 231-avoiding even Grassmannian permutations of size n+1. - Juan B. Gil, Mar 10 2023
For n > 0, a(n) is the smallest number that requires n iterations of the map k -> k - floor(sqrt(k)) to reach 0. - Jon E. Schoenfield, Jun 24 2023
a(n) agrees with the lower matching number of the (n + 1) X (n + 1) black bishop graph from n = 1 up to at least n = 14. - Eric W. Weisstein, Dec 23 2024
For n > 0, obtain a positive integer a(n+1) recursively from a(n) by minimizing a(n+1) > a(n) so that each gap between a(k) and a(k+1) for 1 <= k <= n is used at most twice. - Gerold Jäger, Jun 04 2025
From Roger Ford, May 19 2025: (Start)
a(n) = the number of different total arch lengths for the top arches of semi-meanders with n+2 arches.
Example: Each arch length equals 1 + the number of covered arches.
For semi-meanders with 5 top arches there are 3 different values.
/\
//\\ /\ /\
///\\\ //\\ /\ / \
////\\\\ /\ ///\\\ //\\ //\/\\ /\ /\
Total arch lengths: 4+3+2+1 +1= 11 3+2+1 2+1= 9 3+1+1 +1 +1= 7, so a(3) = 3.
For semi-meanders with 6 top arches there are 5 values: 8, 10, 12, 14, 16, so a(4) = 5. (End)

Examples

			First 4 rows can be taken to be 1,2,5,10,17,...; 3,4,6,11,18,...; 7,8,9,12,19,...; 13,14,15,16,20,...
Ulam square spiral = 7 8 9 / 6 1 2 / 5 4 3 /...; changes of direction (right-angle) at 1 2 3 5 7 ...
From _Joerg Arndt_, May 10 2013: (Start)
The a(7)=13 unimodal compositions of 7 with maximal part <= 2 are
  01:  [ 1 1 1 1 1 1 1 ]
  02:  [ 1 1 1 1 1 2 ]
  03:  [ 1 1 1 1 2 1 ]
  04:  [ 1 1 1 2 1 1 ]
  05:  [ 1 1 1 2 2 ]
  06:  [ 1 1 2 1 1 1 ]
  07:  [ 1 1 2 2 1 ]
  08:  [ 1 2 1 1 1 1 ]
  09:  [ 1 2 2 1 1 ]
  10:  [ 1 2 2 2 ]
  11:  [ 2 1 1 1 1 1 ]
  12:  [ 2 2 1 1 1 ]
  13:  [ 2 2 2 1 ]
(End)
G.f. = 1 + x + 2*x^2 + 3*x^3 + 5*x^4 + 7*x^5 + 10*x^6 + 13*x^7 + 17*x^8 + ...
		

Crossrefs

Equals A002620 + 1.
Cf. A002878, A004652, A002984, A083479, A080037 (complement, except 2).
A002522 lists the even-indexed terms of this sequence.

Programs

  • Haskell
    a033638 = (+ 1) . (`div` 4) . (^ 2)  -- Reinhard Zumkeller, Apr 06 2012
    
  • Magma
    [n^2 div 4 + 1: n in [0.. 50]]; // Vincenzo Librandi, Jul 31 2016
    
  • Maple
    with(combstruct):ZL:=[st,{st=Prod(left,right),left=Set(U,card=r),right=Set(U,card=3)}, unlabeled]: subs(r=1,stack): seq(count(subs(r=2,ZL),size=m),m=6..62); # Zerinvary Lajos, Mar 09 2007
    A033638 := proc(n)
            1+floor(n^2/4) ;
    end proc: # R. J. Mathar, Jul 13 2012
  • Mathematica
    a[n_] := a[n] = 2*a[n - 1] - 2*a[n - 3] + a[n - 4]; a[0] = a[1] = 1; a[2] = 2; a[3] = 3; Array[a, 54, 0] (* Robert G. Wilson v, Mar 28 2011 *)
    LinearRecurrence[{2, 0, -2, 1}, {1, 1, 2, 3}, 60] (* Robert G. Wilson v, Sep 16 2012 *)
  • PARI
    {a(n) = n^2\4 + 1} /* Michael Somos, Apr 03 2007 */
    
  • Python
    def A033638(n): return (n**2>>2)+1 # Chai Wah Wu, Jul 27 2022

Formula

a(n) = ceiling((n^2+3)/4) = ( (7 + (-1)^n)/2 + n^2 )/4.
a(n) = A001055(prime^n), number of factorizations. - Reinhard Zumkeller, Dec 29 2001
G.f.: (1-x+x^3)/((1-x)^2*(1-x^2)); a(n) = a(n-1) + a(n-2) - a(n-3) + 1. - Jon Perry, Jul 07 2004
a(n) = a(n-2) + n - 1. - Paul Barry, Jul 14 2004
a(0) = 1; a(1) = 1; for n > 1 a(n) = a(n-1) + round(sqrt(a(n-1))). - Jonathan Vos Post, Jan 19 2006
a(n) = floor((n^2)/4) + 1.
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n > 3. - Philippe Deléham, Nov 03 2008
a(0) = a(1) = 1, a(n) = a(n-1) + ceiling(sqrt(a(n-2))) for n > 1. - Jonathan Vos Post, Oct 08 2011
a(n) = floor(b(n)) with b(n) = b(n-1) + n/(1+e^(1/n)) and b(0)= 1. - Richard R. Forberg, Jun 08 2013
a(n) = a(n-1) + floor(n/2). - Michel Lagneau, Jul 11 2014
From Ilya Gutkovskiy, Oct 07 2016: (Start)
E.g.f.: (exp(-x) + (7 + 2*x + 2*x^2)*exp(x))/8.
a(n) = Sum_{k=0..n} A123108(k).
Convolution of A008619 and A179184. (End)
a(n) = (n^2 - n + 4)/2 - a(n-1) for n >= 1. - Kritsada Moomuang, Aug 03 2019

A195040 Square array read by antidiagonals with T(n,k) = k*n^2/4+(k-4)*((-1)^n-1)/8, n>=0, k>=0.

Original entry on oeis.org

0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 3, 2, 1, 0, 1, 4, 5, 3, 1, 0, 0, 7, 8, 7, 4, 1, 0, 1, 9, 13, 12, 9, 5, 1, 0, 0, 13, 18, 19, 16, 11, 6, 1, 0, 1, 16, 25, 27, 25, 20, 13, 7, 1, 0, 0, 21, 32, 37, 36, 31, 24, 15, 8, 1, 0, 1, 25, 41, 48, 49, 45, 37, 28, 17, 9, 1, 0
Offset: 0

Views

Author

Omar E. Pol, Sep 27 2011

Keywords

Comments

Also, if k >= 2 and m = 2*k, then column k lists the numbers of the form k*n^2 and the centered m-gonal numbers interleaved.
For k >= 3, this is also a table of concentric polygonal numbers. Column k lists the concentric k-gonal numbers.
It appears that the first differences of column k are the numbers that are congruent to {1, k-1} mod k, if k >= 3.

Examples

			Array begins:
  0,   0,   0,   0,   0,   0,   0,   0,   0,   0, ...
  1,   1,   1,   1,   1,   1,   1,   1,   1,   1, ...
  0,   1,   2,   3,   4,   5,   6,   7,   8,   9, ...
  1,   3,   5,   7,   9,  11,  13,  15,  17,  19, ...
  0,   4,   8,  12,  16,  20,  24,  28,  32,  36, ...
  1,   7,  13,  19,  25,  31,  37,  43,  49,  55, ...
  0,   9,  18,  27,  36,  45,  54,  63,  72,  81, ...
  1,  13,  25,  37,  49,  61,  73,  85,  97, 109, ...
  0,  16,  32,  48,  64,  80,  96, 112, 128, 144, ...
  1,  21,  41,  61,  81, 101, 121, 141, 161, 181, ...
  0,  25,  50,  75, 100, 125, 150, 175, 200, 225, ...
  ...
		

Crossrefs

Rows n: A000004 (n=0), A000012 (n=1), A001477 (n=2), A005408 (n=3), A008586 (n=4), A016921 (n=5), A008591 (n=6), A017533 (n=7), A008598 (n=8), A215145 (n=9), A008607 (n=10).
Columns k: A000035 (k=0), A004652 (k=1), A000982 (k=2), A077043 (k=3), A000290 (k=4), A032527 (k=5), A032528 (k=6), A195041 (k=7), A077221 (k=8), A195042 (k=9), A195142 (k=10), A195043 (k=11), A195143 (k=12), A195045 (k=13), A195145 (k=14), A195046 (k=15), A195146 (k=16), A195047 (k=17), A195147 (k=18), A195048 (k=19), A195148 (k=20), A195049 (k=21), A195149 (k=22), A195058 (k=23), A195158 (k=24).

Programs

  • GAP
    nmax:=13;; T:=List([0..nmax],n->List([0..nmax],k->k*n^2/4+(k-4)*((-1)^n-1)/8));; b:=List([2..nmax],n->OrderedPartitions(n,2));;
    a:=Flat(List([1..Length(b)],i->List([1..Length(b[i])],j->T[b[i][j][2]][b[i][j][1]]))); # Muniru A Asiru, Jul 19 2018
  • Maple
    A195040 := proc(n,k)
            k*n^2/4+((-1)^n-1)*(k-4)/8 ;
    end proc:
    for d from 0 to 12 do
            for k from 0 to d do
                    printf("%d,",A195040(d-k,k)) ;
            end do:
    end do; # R. J. Mathar, Sep 28 2011
  • Mathematica
    t[n_, k_] := k*n^2/4+(k-4)*((-1)^n-1)/8; Flatten[ Table[ t[n-k, k], {n, 0, 11}, {k, 0, n}]] (* Jean-François Alcover, Dec 14 2011 *)

A035106 1, together with numbers of the form k*(k+1) or k*(k+2), k > 0.

Original entry on oeis.org

1, 2, 3, 6, 8, 12, 15, 20, 24, 30, 35, 42, 48, 56, 63, 72, 80, 90, 99, 110, 120, 132, 143, 156, 168, 182, 195, 210, 224, 240, 255, 272, 288, 306, 323, 342, 360, 380, 399, 420, 440, 462, 483, 506, 528, 552, 575, 600, 624, 650, 675, 702, 728, 756, 783, 812, 840
Offset: 1

Views

Author

N. J. A. Sloane, revised Oct 30 2001

Keywords

Comments

Largest integer m such that every permutation (p_1, ..., p_n) of (1, ..., n) satisfies p_i * p_{i+1} >= m for some i, 1 <= i <= n-1. Equivalently, smallest integer m such that there exists a permutation (p_1, ..., p_n) of (1, ..., n) satisfying p_i * p_{i+1} <= m for every i, 1 <= i <= n-1.
Also, nonsquare positive integers m such that floor(sqrt(m)) divides m. - Max Alekseyev, Nov 27 2006
Also, for n>1, a(n) is the number of non-isomorphic simple connected undirected graphs having n+1 edges and a longest path of length n. - Nathaniel Gregg, Nov 02 2021

Examples

			n=5: we must arrange the numbers 1..5 so that the max of the products of pairs of adjacent terms is minimized. The answer is 51324, with max product = 8, so a(5) = 8.
		

Crossrefs

First differences give (essentially) A028242.
Bisections: A002378 (pronic numbers) and A005563.

Programs

  • GAP
    Concatenation([1], List([2..60], n-> (2*n*(n+2) +3*((-1)^n -1))/8)); # G. C. Greubel, Jun 10 2019
  • Haskell
    import Data.List.Ordered (union)
    a035106 n = a035106_list !! (n-1)
    a035106_list = 1 : tail (union a002378_list a005563_list)
    -- Reinhard Zumkeller, Oct 05 2015
    
  • Magma
    [1] cat [(2*n*(n+2) +3*((-1)^n -1))/8: n in [2..60]]; // G. C. Greubel, Jun 10 2019
    
  • Mathematica
    Join[{1},LinearRecurrence[{2,0,-2,1},{2,3,6,8},60]] (* or *) Join[{1}, Table[ If[EvenQ[n],(n(n+2))/4,((n-1)(n+3))/4],{n,2,60}]] (* Harvey P. Dale, May 03 2012 *)
  • PARI
    my(x='x+O('x^60)); Vec(x*(x^4-2*x^3+x^2-1)/((x-1)^3*(x+1))) \\ Altug Alkan, Oct 23 2015
    
  • PARI
    A035106(n)=!(n-1)+floor((n^2)/4+n/2); \\ R. J. Cano, Jul 24 2023
    
  • Sage
    [1]+[(2*n*(n+2) +3*((-1)^n -1))/8 for n in (2..60)] # G. C. Greubel, Jun 10 2019
    

Formula

For n > 1, a(n) = n*(n+2)/4 if n is even and (n-1)*(n+3)/4 if n is odd. - Jud McCranie, Oct 25 2001
a(n) = a(n-1) + a(n-2) - a(n-3) + 1 = A002620(n+2) + A004526(n+2). - Henry Bottomley, Mar 08 2000
a(n+2) = (2*n^2 + 12*n + 3*(-1)^n + 13)/8, with a(1)=1, i.e., a(n+2) = (n+2)*(n+4)/4 if n is even and (n+1)*(n+5)/4 if n is odd. - Vladeta Jovovic, Oct 23 2001
From Cecilia Rossiter (cecilia(AT)noticingnumbers.net), Dec 14 2004: (Start)
a(n) = a(n-2) + (n-1), where a(1) = 0, a(2) = 0.
a(n) = (2*(n+1)^2 + 3*(-1)^n - 5)/8, n>=2, with a(1)=1. (End)
For n > 1, a(n) = floor((n+1)^4/(4*(n+1)^2+1)). - Gary Detlefs, Feb 11 2010
For n > 1, a(n) = n + ceiling((1/4)*(n-1)^2) - 1. - Clark Kimberling, Jan 07 2011; corrected by Arkadiusz Wesolowski, Sep 25 2012
a(1)=1, a(2)=2, a(3)=3, a(4)=6, a(5)=8; for n > 5, a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). - Harvey P. Dale, May 03 2012
G.f.: x + x^2*(2-x) / ( (1+x)*(1-x)^3 ) = x*(x^4 - 2*x^3 + x^2 - 1)/((x-1)^3*(x+1)). - Vladeta Jovovic, Oct 23 2001; Harvey P. Dale, May 03 2012
a(n) = floor(n/2)*(1 + ceiling(n/2)), a(1) = 1. - Arkadiusz Wesolowski, Sep 25 2012
a(n) = ceiling((n-1)*(n+3)/4), n > 1. - Wesley Ivan Hurt, Jun 14 2013
a(n+1) - a(n) = A052938(n-2) for n > 1. - Reinhard Zumkeller, Oct 06 2015
E.g.f.: (8*x + 3*exp(-x) - (3-6*x-2*x^2)*exp(x))/8. - G. C. Greubel, Jun 10 2019
Sum_{n>=1} 1/a(n) = 11/4. - Amiram Eldar, Sep 24 2022

Extensions

Edited by Max Alekseyev, Oct 09 2015
Definition modified to allow for the initial 1. - N. J. A. Sloane, May 17 2016

A198442 Number of sequences of n coin flips that win on the last flip, if the sequence of flips ends with (1,1,0) or (1,0,0).

Original entry on oeis.org

0, 0, 2, 3, 6, 8, 12, 15, 20, 24, 30, 35, 42, 48, 56, 63, 72, 80, 90, 99, 110, 120, 132, 143, 156, 168, 182, 195, 210, 224, 240, 255, 272, 288, 306, 323, 342, 360, 380, 399, 420, 440, 462, 483, 506, 528, 552, 575, 600, 624, 650, 675, 702, 728, 756, 783, 812
Offset: 1

Views

Author

Paul Weisenhorn, Oct 25 2011

Keywords

Comments

If the sequence ends with (1,1,0) Abel wins; if it ends with (1,0,0) Kain wins.
Abel(n) = A002620(n-1) = (2*n*(n - 2) + 1 - (-1)^n)/8.
Kain(n) = A004526(n-1) = floor((n - 1)/2).
Win probability for Abel = sum(Abel(n)/2^n) = 2/3.
Win probability for Kain = sum(Kain(n)/2^n) = 1/3.
Mean length of the game = sum(n*a(n)/2^n) = 16/3.
Essentially the same as A035106. - R. J. Mathar, Oct 27 2011
The sequence 2*a(n) is denoted as chi(n) by McKee (1994) and is the degree of the division polynomial f_n as a polynomial in x. He notes that "If x is given weight 1, a is given weight 2, and b is given weight 3, then all the terms in f_n(a, b, x) have weight chi(n)". - Michael Somos, Jan 09 2015
In Duistermaat (2010), at the end of section 11.2 The Elliptic Billiard, on page 492 the number of k-periodic fibers counted with multiplicities of the QRT root is given by equation (11.2.8) as "1/4 k^2 + 3{k/2}(1 - {k/2}) - 1 = n^2 - 1 when k = 2n, n^2 + n when k = 2n+1, for every integer k." - Michael Somos, Mar 14 2023

Examples

			For n = 6 the a(6) = 8 solutions are (0,0,0,1,1,0), (0,1,0,1,1,0),(0,0,1,1,1,0), (1,0,1,1,1,0), (0,1,1,1,1,0),(1,1,1,1,1,0) for Abel and
  (0,0,0,1,0,0), (0,1,0,1,0,0) for Kain.
G.f. = 2*x^3 + 3*x^4 + 6*x^5 + 8*x^6 + 12*x^7 + 15*x^8 + 20*x^9 + ...
		

References

  • J. J. Duistermaat, Discrete Integrable Systems, 2010, Springer Science+Business Media.
  • A. Engel, Wahrscheinlichkeitsrechnung und Statistik, Band 2, Klett, 1978, pages 25-26.

Crossrefs

Programs

  • Magma
    [(2*n^2-5-3*(-1)^n)/8: n in [1..60]]; // Vincenzo Librandi, Oct 28 2011
    
  • Maple
    for n from 1 by 2 to 99 do
      a(n):=(n^2-1)/4:
      a(n+1):=(n+1)^2/4-1:
    end do:
    seq(a(n),n=1..100);
  • Mathematica
    a[ n_] := Quotient[ n^2 - 1, 4]; (* Michael Somos, Jan 09 2015 *)
  • PARI
    a(n)=([1,1,0,0,0,0;0,0,1,1,0,0;0,1,0,0,1,0;0,0,0,1,1,0;0,0,0,0,0,2;0,0,0,0,0,2]^n)[1,5] \\ Charles R Greathouse IV, Oct 26 2011
    
  • PARI
    {a(n) = (n^2 - 1) \ 4}; /* Michael Somos, Jan 09 2015 */
    
  • Perl
    sub a {
        my ($t, $n) = (0, shift);
        for (0..((1<<$n)-1)) {
            my $str = substr unpack("B32", pack("N", $_)), -$n;
            $t++ if ($str =~ /1.0$/ and not $str =~ /1.0./);
        }
        return $t
    } # Charles R Greathouse IV, Oct 26 2011
    
  • Sage
    def A198442():
        yield 0
        x, y = 0, 2
        while True:
           yield x
           x, y = x + y, x//y + 1
    a = A198442(); print([next(a) for i in range(57)]) # Peter Luschny, Dec 22 2015

Formula

a(n) = (2*n^2 - 5 - 3*(-1)^n)/8.
a(2*n) = n^2 - 1; a(2*n+1) = n*(n + 1).
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) with n>=4.
G.f.: x^3*(2 - x)/((1 + x)*(1 - x)^3). - R. J. Mathar, Oct 27 2011
a(n) = a(-n) for all n in Z. a(0) = -1. - Michael Somos, Jan 09 2015
0 = a(n)*(+a(n+1) - a(n+2)) + a(n+1)*(-1 - a(n+1) + a(n+2)) for all n in Z. - Michael Somos, Jan 09 2015
1 = a(n) - a(n+1) - a(n+2) + a(n+3), 2 = a(n) - 2*a(n+2) + a(n+4) for all n in Z. - Michael Somos, Jan 09 2015
a(n) = A002620(n+2) - A052928(n+2) for n >= 1. (Note A265611(n) = A002620(n+1) + A052928(n+1) for n >= 1.) - Peter Luschny, Dec 22 2015
a(n+1) = A110654(n)^2 + A110654(n)*(2 - (n mod 2)), n >= 0. - Fred Daniel Kline, Jun 08 2016
a(n) = A004526(n)*A004526(n+3). - Fred Daniel Kline, Aug 04 2016
a(n) = floor((n^2 - 1)/4). - Bruno Berselli, Mar 15 2021

Extensions

a(12) inserted by Charles R Greathouse IV, Oct 26 2011

A054772 Triangle T(n,k) of n X n binary matrices with k=0..n^2 ones, up to rotational symmetry.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 10, 22, 34, 34, 22, 10, 3, 1, 1, 4, 32, 140, 464, 1092, 2016, 2860, 3238, 2860, 2016, 1092, 464, 140, 32, 4, 1, 1, 7, 78, 578, 3182, 13302, 44330, 120230, 270525, 510875, 817388, 1114548, 1300316, 1300316, 1114548, 817388
Offset: 0

Views

Author

Vladeta Jovovic, May 18 2000

Keywords

Comments

Row sums give A047937.
From Wolfdieter Lang, Oct 01 2016: (Start)
The formula is obtained from Pólya's counting theorem. See, e.g., the Harary-Palmer reference.
The cycle index for a square grid of n X n squares G(n), n >= 1, under the cyclic group C_4 is
(s[1]^(n^2)+s[2]^(n^2/2)+2*s[4]^(n^2/4))/4 if n is even,
s[1]*(s[1]^(n^2-1) + s[2]^((n^2-1)/2) + 2*s[4]^((n^2-1)/4))/4 if n is odd. (Numerate the squares from 1 .. n^2 and compute for the C_4 rotations the cycle structure of the permutation from the symmetric group S(n^2)).
The figure counting series is c(x) = 1+x for coloring, say black and white (in the matrix case binary entries).
Therefore the counting series is C(n,x) = G(n) with substitution s[2^j] = c(x^(2*j)) = 1 + x^(2^j) for j=0,1,2. Row n gives the coefficients of C(n,x) in rising (or falling) order. (End)
A pedantic note: One should not use 0,1 matrices for this T(n,k) model because 1 (also |) is not C_4 invariant. Square grids with coloring of the squares, say black and white, or central entries o and + are better suited. - Wolfdieter Lang, Oct 02 2016

Examples

			[1],[1,1],[1,1,2,1,1],[1,3,10,22,34,34,22,10,3,1],...;
There are 10 inequivalent 3 X 3 binary matrices with 2 ones, up to rotational symmetry:
[0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 0]
[0 0 0] [0 0 0] [0 0 0] [0 0 1] [0 0 1]
[0 1 1] [1 0 1] [1 1 0] [0 1 0] [1 0 0]
-------
[0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 1]
[0 1 0] [0 1 0] [1 0 0] [1 0 1] [0 0 0]
[0 0 1] [0 1 0] [0 0 1] [0 0 0] [1 0 0].
- reformatted. _Wolfdieter Lang_, Oct 01 2016
See a remark above: use o for 0 and + for 1.
n=3: Cycle index G(3) = s[1]*(s[1]^8 + s[2]^4 + 2*s[4]^2)/4. C(3,x) = (1+x)*((1+x)^8 + (1+x^2)^4 + 2*(1+x^4)^2)/4 = 1 + 3*x + 10*x^2 + 22*x^3 + 34*x^4 + 34*x^5 + 22*x^6 + 10*x^7 + 3*x^8 + x^9. - _Wolfdieter Lang_, Oct 01 2016
		

References

  • F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973, p. 42, (2.4.6).

Crossrefs

Cf. A054252, columns k=0..4: A000012, A004652, A212714, A011863, A275799.

Formula

See the comment above: T(n,k) = [x^k]C(n,x), with the counting series C(n,x) obtained from the cycle index for the n X n grid under C_4 rotations G(n;s[1],s[2],s[4]) with s[2^j] = 1 + x^(2^j) for j=0,1,2. - Wolfdieter Lang, Oct 01 2016

A201384 T(n,k)=Number of nXk 0..1 arrays with rows and columns lexicographically nondecreasing and the instance counts of every value within one of each other.

Original entry on oeis.org

2, 1, 1, 2, 3, 2, 1, 4, 4, 1, 2, 7, 19, 7, 2, 1, 9, 27, 27, 9, 1, 2, 13, 115, 121, 115, 13, 2, 1, 16, 122, 483, 483, 122, 16, 1, 2, 21, 467, 1751, 7148, 1751, 467, 21, 2, 1, 25, 433, 5694, 24779, 24779, 5694, 433, 25, 1, 2, 31, 1461, 16870, 295813, 326650, 295813, 16870
Offset: 1

Views

Author

R. H. Hardin Nov 30 2011

Keywords

Comments

Table starts
.2..1....2......1........2..........1............2..............1
.1..3....4......7........9.........13...........16.............21
.2..4...19.....27......115........122..........467............433
.1..7...27....121......483.......1751.........5694..........16870
.2..9..115....483.....7148......24779.......295813.........804538
.1.13..122...1751....24779.....326650......3826202.......39589830
.2.16..467...5694...295813....3826202....175765510.....1819250859
.1.21..433..16870...804538...39589830...1819250859....74872992399
.2.25.1461..46014..7711613..364013320..65629320845..2730227923892
.1.31.1208.116842.17135660.3005372641.534428405524.88478723671041

Examples

			Some solutions for n=4 k=7
..0..0..0..0..1..1..1....0..0..0..1..1..1..1....0..0..0..0..0..1..1
..0..0..0..1..1..1..1....0..0..1..0..0..0..1....0..0..0..1..1..0..1
..0..1..1..1..0..0..0....1..1..0..0..0..0..1....0..0..1..1..1..1..0
..1..1..1..1..0..0..0....1..1..1..0..0..1..1....0..1..0..1..1..1..1
		

Crossrefs

Column 2 is A004652(n+1)

A343874 Array read by antidiagonals: T(n,k) is the number of n X n nonnegative integer matrices with sum of elements equal to k, up to rotational symmetry.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 3, 3, 1, 0, 1, 5, 13, 4, 1, 0, 1, 10, 43, 36, 7, 1, 0, 1, 14, 129, 204, 85, 9, 1, 0, 1, 22, 327, 980, 735, 171, 13, 1, 0, 1, 30, 761, 3876, 5145, 2109, 313, 16, 1, 0, 1, 43, 1619, 13596, 29715, 20610, 5213, 528, 21, 1
Offset: 0

Views

Author

Andrew Howroyd, May 06 2021

Keywords

Examples

			Array begins:
=====================================================
n\k | 0  1   2    3     4      5       6        7
----+------------------------------------------------
  0 | 1  0   0    0     0      0       0        0 ...
  1 | 1  1   1    1     1      1       1        1 ...
  2 | 1  1   3    5    10     14      22       30 ...
  3 | 1  3  13   43   129    327     761     1619 ...
  4 | 1  4  36  204   980   3876   13596    42636 ...
  5 | 1  7  85  735  5145  29715  148561   657511 ...
  6 | 1  9 171 2109 20610 164502 1124382  6744582 ...
  7 | 1 13 313 5213 67769 717509 6457529 50732669 ...
  ...
		

Crossrefs

Rows n=0..4 are A000007, A000012, A008610, A054771, A054773.
Columns k=0..1 are A000012, A004652.
Cf. A054772 (binary case), A318795, A343095, A343875.

Programs

  • PARI
    U(n,s)={(s(1)^(n^2) + s(1)^(n%2)*(2*s(4)^(n^2\4) + s(2)^(n^2\2)))/4}
    T(n,k)={polcoef(U(n,i->1/(1-x^i) + O(x*x^k)), k)}

A104027 Triangle, read by rows, equal to the matrix inverse of A056241, which is formed from the even-indexed trinomial coefficients.

Original entry on oeis.org

1, -1, 1, 2, -3, 1, -7, 12, -6, 1, 41, -73, 41, -10, 1, -376, 675, -390, 105, -15, 1, 5033, -9048, 5256, -1446, 225, -21, 1, -92821, 166901, -97034, 26796, -4242, 427, -28, 1, 2257166, -4058703, 2359939, -652054, 103515, -10570, 742, -36, 1, -69981919, 125837748, -73169550, 20218251, -3210939
Offset: 0

Views

Author

Paul D. Hanna, Feb 26 2005

Keywords

Comments

Column 0 forms signed Hammersley's polynomial p_n(1) (A006846). Column 1 forms A104028.
Triangle T(n,k), 0<=k<=n, read by rows, given by [ -1, -1, -3, -4, -7, -9, -13, -16, -21, ...] DELTA [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, ...] where DELTA is the operator defined in A084938; see A004652 : 0, 1, 1, 3, 4, 7, 9, 13, ... - Philippe Deléham, Sep 26 2005

Examples

			Rows begin:
1;
-1,1;
2,-3,1;
-7,12,-6,1;
41,-73,41,-10,1;
-376,675,-390,105,-15,1;
5033,-9048,5256,-1446,225,-21,1;
-92821,166901,-97034,26796,-4242,427,-28,1;
2257166,-4058703,2359939,-652054,103515,-10570,742,-36,1; ...
		

Crossrefs

Programs

  • PARI
    T(n,k)=if(n
    				

A035104 First differences give (essentially) A028242.

Original entry on oeis.org

1, 4, 9, 13, 19, 24, 31, 37, 45, 52, 61, 69, 79, 88, 99, 109, 121, 132, 145, 157, 171, 184, 199, 213, 229, 244, 261, 277, 295, 312, 331, 349, 369, 388, 409, 429, 451, 472, 495, 517, 541, 564, 589, 613, 639, 664, 691, 717, 745, 772, 801, 829, 859, 888, 919
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [(5+3*(-1)^n+28*n+2*n^2)/8: n in [0..60]]; // Vincenzo Librandi, Oct 20 2013
  • Mathematica
    CoefficientList[Series[(3 x^3 - x^2 - 2 x - 1)/((x - 1)^3 (x + 1)), {x, 0, 60}], x] (* Vincenzo Librandi, Oct 20 2013 *)

Formula

From Colin Barker, Mar 04 2013: (Start)
a(n) = (5+3*(-1)^n+28*n+2*n^2)/8.
a(n) = 2*a(n-1)-2*a(n-3)+a(n-4).
G.f.: (3*x^3-x^2-2*x-1) / ((x-1)^3*(x+1)). (End)
Sum_{n>=0} 1/a(n) = 983/990 + tan(3*sqrt(5)*Pi/2)*Pi/(3*sqrt(5)) - cot(2*sqrt(3)*Pi)*Pi/(4*sqrt(3)). - Amiram Eldar, Sep 24 2022

Extensions

More terms from Vincenzo Librandi, Oct 20 2013
Showing 1-10 of 22 results. Next