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.

Previous Showing 21-26 of 26 results.

A159915 a(n) = floor((n+1)/4)*floor(n/2).

Original entry on oeis.org

0, 0, 0, 1, 2, 2, 3, 6, 8, 8, 10, 15, 18, 18, 21, 28, 32, 32, 36, 45, 50, 50, 55, 66, 72, 72, 78, 91, 98, 98, 105, 120, 128, 128, 136, 153, 162, 162, 171, 190, 200, 200, 210, 231, 242, 242, 253, 276, 288, 288, 300, 325, 338, 338, 351, 378, 392, 392, 406, 435, 450, 450
Offset: 0

Views

Author

M. F. Hasler, May 01 2009, May 03 2009

Keywords

Comments

Half the number of (n-2)-element subsets of {1,...,n} with odd sum of the elements.
This is half the antepenultimate column of A159916, cf. formula.
The number of subsets of {1,...,n} with n-2 elements, adding up to an odd integer, is always even (cf. examples), so we divide it by 2.
We prefer to include a(0)=a(1)=a(2)=0, even if it might seem more natural to start only at n=2 or n=3.
From the rational g.f. it can be seen that the sequence is a linear recurrence with constant coefficients (3,-5,7,-7,5,-3,1) of order 7.
A quasipolynomial of order 4 and degree 2. - Charles R Greathouse IV, Sep 18 2024

Examples

			a(0)=a(1)=0 since there are no subsets with -2 or -1 elements.
a(2)=0 since the sum of the elements of a 0-element subset is zero.
a(3)=1 since for n=3 we have two singleton subsets of {1,2,3}, {1} and {3}, with odd sum of elements.
a(4)=2 since for n=4 we have four 2-element subsets of {1,2,3,4} with odd sum: {1,2}, {2,3}, {1,4}, {3,4}.
		

Crossrefs

Programs

  • Magma
    A159915:= func< n | Floor((n+1)/4)*Floor(n/2) >;
    [A159915(n): n in [0..70]]; // G. C. Greubel, Sep 18 2024
    
  • Mathematica
    Table[Floor[(n+1)/4]*Floor[n/2], {n,0,70}] (* G. C. Greubel, Sep 18 2024 *)
  • PARI
    A159915(n)= polcoeff( (1-x+x^2)/((1-x)^3*(1+x^2)^2) + O(x^(n-2)), n-3);
    a(n,t=[0,0,0,1,2,2,3],c=[1,-3,5,-7,7,-5,3]~)=while(n-->5,t=concat(vecextract(t,"^1"),t*c));t[n+2] /* Note: a(n+1,[0,0,0,0,1,2,2]) gives the same result as a(n) */
    
  • PARI
    A159915(n)=(n+1)\4*(n\2) \\ M. F. Hasler, May 03 2009
    
  • SageMath
    def A159915(n): return ((n+1)//4)*(n//2)
    [A159915(n) for n in range(71)] # G. C. Greubel, Sep 18 2024

Formula

G.f.: x^3*(1 - x + x^2)/(1 - 3*x + 5*x^2 - 7*x^3 + 7*x^4 - 5*x^5 + 3*x^6 - x^7) = x^3*(1-x+x^2)/((1-x)^3*(1+x^2)^2).
a(n) = 3*a(n-1) - 5*a(n-2) + 7*a(n-3) - 7*a(n-4) + 5*a(n-5) - 3*a(n-6) + a(n-7) for n > 7.
For n > 2, a(n) = A159916(n*(n-1)/2 + n - 2)/2 = T(n,n-2)/2 as defined there.
From M. F. Hasler, May 03 2009: (Start)
a(n) = floor((n+1)/4)*floor(n/2).
a(2n+1) = A093005(n).
a(2n) = A093353(n-1) = floor(n/2)*n. (End)
a(n) ~ n^2/8. - Charles R Greathouse IV, Sep 18 2024

A238411 a(n) = 2*n*floor(n/2).

Original entry on oeis.org

0, 4, 6, 16, 20, 36, 42, 64, 72, 100, 110, 144, 156, 196, 210, 256, 272, 324, 342, 400, 420, 484, 506, 576, 600, 676, 702, 784, 812, 900, 930, 1024, 1056, 1156, 1190, 1296, 1332, 1444, 1482, 1600, 1640, 1764, 1806, 1936, 1980, 2116, 2162, 2304, 2352, 2500
Offset: 1

Views

Author

Emeric Deutsch, Feb 27 2014

Keywords

Comments

For n>=3, a(n) = the eccentric connectivity index of the cycle C[n] on n vertices. The eccentric connectivity index of a simple connected graph G is defined as the sum over all vertices i of G of the product E(i)D(i), where E(i) is the eccentricity and D(i) is the degree of vertex i. For example, a(6)=36 because each vertex of C[6] has degree 2 and eccentricity 3; 6*2*3 = 36.

Crossrefs

Cf. A093353.

Programs

  • Magma
    [2*n*Floor(n/2): n in [1..50]]; // Bruno Berselli, Feb 25 2016
  • Maple
    a := proc (n) options operator, arrow: 2*n*floor((1/2)*n) end proc: seq(a(n), n = 1 .. 70);
  • Mathematica
    Table[2 n Floor[n/2], {n, 1, 50}] (* Bruno Berselli, Feb 25 2016 *)
  • Maxima
    makelist(2*n*floor(n/2), n, 1, 50); /* Bruno Berselli, Feb 25 2016 */
    
  • Sage
    [2*n*floor(n/2) for n in (1..50)] # Bruno Berselli, Feb 25 2016
    

Formula

From Bruno Berselli, Feb 25 2016: (Start)
G.f.: 2*x*(2 + x + x^2)/((1 + x)^2*(1 - x)^3).
a(n) = n*(2*n + (-1)^n - 1)/2.
a(n+1) = 2*A093353(n). (End)

A178946 a(n) = n*(n+1)*(2*n+1)/6 - n*floor(n/2).

Original entry on oeis.org

1, 3, 11, 22, 45, 73, 119, 172, 249, 335, 451, 578, 741, 917, 1135, 1368, 1649, 1947, 2299, 2670, 3101, 3553, 4071, 4612, 5225, 5863, 6579, 7322, 8149, 9005, 9951, 10928, 12001, 13107, 14315, 15558, 16909, 18297, 19799, 21340, 23001
Offset: 1

Views

Author

Gary W. Adamson, Dec 30 2010

Keywords

Comments

Previous name was: A modified variant of A005900.
Let S(x) = (1, 3, 5, 7,...); then A178946 = (1/2) * ((S(x)^2 + S(x^2)).
If n is even, a(n) is the sum of the first n squares minus n^2/2. If n is odd, a(n) is the sum of the first n squares minus n(n-1)/2. - Wesley Ivan Hurt, Sep 17 2013

Examples

			(1/2) *((1, 6, 19, 44, 85, 146, 231,...) + (1, 0, 3, 0, 5, 0, 7, 0, 9,...)) =
(1, 3, 11, 22, 45, 73, 119,...).
		

Crossrefs

Programs

  • Magma
    [n*(n+1)*(2*n+1)/6 - n*Floor(n/2): n in [1..50]]; // Vincenzo Librandi, Sep 17 2013
  • Maple
    A005900 := proc(n) n*(2*n^2+1)/3 ; end proc:
    A178946 := proc(n) if type(n,'even') then A005900(n)/2 ; else (A005900(n)+n)/2 ; end if;end proc:
    seq(A178946(n),n=1..60) ; # R. J. Mathar, Jan 03 2011
    seq(k*(k+1)*(2*k+1)/6 - k*floor(k/2), k=1..100); # Wesley Ivan Hurt, Sep 17 2013
  • Mathematica
    Table[n(n+1)(2n+1)/6-n*Floor[n/2], {n,100}] (* Wesley Ivan Hurt, Sep 17 2013 *)
    LinearRecurrence[{2,1,-4,1,2,-1},{1,3,11,22,45,73},50] (* Harvey P. Dale, Mar 20 2018 *)

Formula

a(2n) = A005900(2n)/2. a(2n+1) = (A005900(2n+1)+2n+1)/2.
a(n) = +2*a(n-1) +a(n-2) -4*a(n-3) +a(n-4) +2*a(n-5) -a(n-6). G.f.: x*(1+x+4*x^2+x^4+x^3) / ( (1+x)^2*(x-1)^4 ). - R. J. Mathar, Jan 03 2011
a(n) = A000330(n+1) - A093353(n), n>0. - Wesley Ivan Hurt, Sep 17 2013

Extensions

Better name using formula from Wesley Ivan Hurt, Joerg Arndt, Sep 17 2013

A182021 Achromatic number of n-cycle.

Original entry on oeis.org

3, 2, 3, 3, 3, 4, 4, 5, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 12, 13
Offset: 3

Views

Author

N. J. A. Sloane, Apr 06 2012

Keywords

References

  • Hare, W. R.; Hedetniemi, S. T.; Laskar, R.; Pfaff, J. Complete coloring parameters of graphs. Proceedings of the sixteenth Southeastern international conference on combinatorics, graph theory and computing (Boca Raton, Fla., 1985). Congr. Numer. 48 (1985), 171--178. MR0830709 (87h:05088)

Programs

  • Maple
    A093353 := proc(n)
        if n < 1 then
            0;
        else
            (n + modp(n,2))*(n+1)/2 ;
        end if;
    end proc:
    A182021 := proc(n)
        for m from 0 do
            sm := A093353(m-1) ;
            if sm >  n then
                m := m-1 ;
                sm := A093353(m-1) ;
                if type(m,'odd') and n = sm+1 then
                    return m-1 ;
                else
                    return m;
                end if;
            end if;
        end do:
    end proc:
    seq(A182021(n),n=3..80) ; # R. J. Mathar, Jul 12 2013
  • Mathematica
    A093353[n_] := If[n < 1, 0, (n+Mod[n, 2])*(n+1)/2];
    a[n_] := For[m = 0, True, m++, sm = A093353[m-1]; If[sm > n, m = m-1; sm = A093353[m-1]; If[OddQ[m] && n == sm+1, Return[m-1], Return[m]]]];
    Table[a[n], {n, 3, 80}] (* Jean-François Alcover, Apr 15 2023, after R. J. Mathar *)

Formula

Let s_m = m^2/2 if m even, m(m-1)/2 if m odd. For m >= 0, the s_m sequence is 0, 0, 2, 3, 8, 10, 18, 21, 32, 36, 50, ... (A093353 with a different offset).
Suppose s_m <= n < s_{m+1}. If m is odd and n = s_m + 1 then a(n) = m-1, otherwise a(n) = m.

A226731 a(n) = (2n - 1)!/(2n).

Original entry on oeis.org

20, 630, 36288, 3326400, 444787200, 81729648000, 19760412672000, 6082255020441600, 2322315553259520000, 1077167364120207360000, 596585001666576384000000, 388888194657798291456000000
Offset: 3

Views

Author

Wesley Ivan Hurt, Jun 15 2013

Keywords

Comments

For n < 3, the formula does not produce an integer.
The ratio of the product of the partition parts of 2n into exactly two parts to the sum of the partition parts of 2n into exactly two parts. For example, a(3) = 20, and 2*3 = 6 has 3 partitions into exactly two parts: (5,1), (4,2), (3,3). Forming the ratio of product to sum (of parts), we have (5*1*4*2*3*3)/(5+1+4+2+3+3) = 360/18 = 20. - Wesley Ivan Hurt, Jun 24 2013

Examples

			a(3) = (2*3 - 1)!/(2*3) = 5!/6 = 120/6 = 20.
		

Crossrefs

Programs

Formula

a(n) = A009445(n-1)/A005843(n) = A002674(n)/A001105(n). - Wesley Ivan Hurt, Jun 24 2013
a(n) ~ sqrt(Pi)*2^(2*n-1)*n^(2*n-3/2)/exp(2*n). - Ilya Gutkovskiy, Nov 01 2016
From Amiram Eldar, Mar 10 2022: (Start)
Sum_{n>=3} 1/a(n) = e - 8/3.
Sum_{n>=3} (-1)^(n+1)/a(n) = cos(1) + sin(1) - 4/3. (End)

A242371 Modified eccentric connectivity index of the cycle graph with n vertices, C[n].

Original entry on oeis.org

12, 32, 40, 72, 84, 128, 144, 200, 220, 288, 312, 392, 420, 512, 544, 648, 684, 800, 840, 968, 1012, 1152, 1200, 1352, 1404, 1568, 1624, 1800, 1860, 2048, 2112, 2312, 2380, 2592, 2664, 2888, 2964, 3200, 3280, 3528, 3612, 3872, 3960, 4232, 4324, 4608, 4704
Offset: 3

Views

Author

Nilanjan De, Jun 08 2014

Keywords

Comments

The modified eccentric connectivity index of a graph is defined as the sum of the products of eccentricity with the total degree of neighboring vertices, over all vertices of the graph. This is a generalization of eccentric connectivity index.
a(n) = 4*A093353(n-1) = n*A168273(n) for n>2. - Alois P. Heinz, Jun 26 2014

Examples

			a(3) = 3*4 = 12 because there are 3 vertices and each vertex has eccentricity 1 and the total degree of neighboring vertices is 4.
		

Crossrefs

Programs

  • Maple
    a:= n-> n*(2*n-1+(-1)^n):
    seq(a(n), n=3..60);  # Alois P. Heinz, Jun 26 2014
  • Mathematica
    a[n_] := 2n(n-Boole[OddQ[n]]);
    Table[a[n], {n, 3, 50}] (* Jean-François Alcover, Nov 28 2018 *)
  • PARI
    a(n) = if (n % 2, 2*n*(n-1), 2*n^2); \\ Michel Marcus, Jun 20 2014

Formula

a(n) = 2*n*(n-1) if n is odd; and a(n) = 2*n^2 if n is even (n>2).
G.f.: -4*x^3*(3+5*x-4*x^2-2*x^3+2*x^4)/((x+1)^2*(x-1)^3). - Alois P. Heinz, Jun 26 2014
Previous Showing 21-26 of 26 results.