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 29 results. Next

A259976 Irregular triangle T(n, k) read by rows (n >= 0, 0 <= k <= A011848(n)): T(n, k) is the number of occurrences of the principal character in the restriction of xi_k to S_(n)^(2).

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 2, 2, 0, 1, 0, 1, 3, 4, 6, 6, 3, 1, 0, 1, 3, 5, 11, 20, 24, 32, 34, 17, 1, 0, 1, 3, 6, 13, 32, 59, 106, 181, 261, 317, 332, 245, 89, 1, 0, 1, 3, 6, 14, 38, 85, 197, 426, 866, 1615, 2743, 4125, 5495, 6318, 6054, 4416, 1637
Offset: 0

Views

Author

N. J. A. Sloane, Jul 12 2015

Keywords

Comments

See Merris and Watkins (1983) for precise definition.

Examples

			The triangle begins:
[0] 1
[1] 1
[2] 1
[3] 1,0,
[4] 1,0,1,1,
[5] 1,0,1,2,2,0,
[6] 1,0,1,3,4,6,6,3,
[7] 1,0,1,3,5,11,20,24,32,34,17
[8] 1,0,1,3,6,13,32,59,106,181,261,317,332,245,89
[9] 1,0,1,3,6,14,38,85,197,426,866,1615,2743,4125,5495,6318,6054,4416,1637
...
		

Crossrefs

Cf. A005368, A000088, A011848. Length of row n is A039823(n-1).
Row n is apparently formed by the first differences of the first half of row n of A008406.

Programs

  • Sage
    from sage.groups.perm_gps.permgroup_element import make_permgroup_element
    for p in range(8):
        m = p*(p-1)//2
        Sm = SymmetricGroup(m)
        denom = factorial(p)
        elements = []
        for perm in SymmetricGroup(p):
            t = perm.tuple()
            eperm = []
            for v2 in range(p):
                for v1 in range(v2):
                    w1, w2 = sorted([t[v1], t[v2]])
                    eperm.append((w2-1)*(w2-2)//2+w1)
            elements.append(make_permgroup_element(Sm, eperm))
        for q in range(m//2+1):
            char = SymmetricGroupRepresentation([m-q, q]).to_character()
            numer = sum(char(e) for e in elements)
            print((p, q), numer//denom)
    # Andrey Zabolotskiy, Aug 28 2018

Formula

From Andrey Zabolotskiy, Aug 28 2018: (Start)
Sum_{ k=0..A011848(n) } T(n,k) * (n*(n-1)/2 - 2*k + 1) = A000088(n).
T(n,k) = A005368(k) for n >= 2*k. (End)

Extensions

Name edited, terms T(7, 9)-T(7, 10) and rows 0-2, 8, 9 added by Andrey Zabolotskiy, Sep 06 2018

A074377 Generalized 10-gonal numbers: m*(4*m - 3) for m = 0, +- 1, +- 2, +- 3, ...

Original entry on oeis.org

0, 1, 7, 10, 22, 27, 45, 52, 76, 85, 115, 126, 162, 175, 217, 232, 280, 297, 351, 370, 430, 451, 517, 540, 612, 637, 715, 742, 826, 855, 945, 976, 1072, 1105, 1207, 1242, 1350, 1387, 1501, 1540, 1660, 1701, 1827, 1870, 2002, 2047, 2185, 2232, 2376, 2425
Offset: 0

Views

Author

W. Neville Holmes, Sep 04 2002

Keywords

Comments

Also called generalized decagonal numbers.
Odd triangular numbers decremented and halved.
It appears that this is zero together with the partial sums of A165998. - Omar E. Pol, Sep 10 2011 [this is correct, see the g.f., Joerg Arndt, Sep 29 2013]
Also, A033954 and positive members of A001107 interleaved. - Omar E. Pol, Aug 04 2012
Also, numbers m such that 16*m+9 is a square. After 1, therefore, there are no squares in this sequence. - Bruno Berselli, Jan 07 2016
Convolution of the sequences A047522 and A059841. - Ilya Gutkovskiy, Mar 16 2017
Numbers k such that the concatenation k5625 is a square. - Bruno Berselli, Nov 07 2018
Exponents in expansion of Product_{n >= 1} (1 + x^(8*n-7))*(1 + x^(8*n-1))*(1 - x^(8*n)) = 1 + x + x^7 + x^10 + x^22 + .... - Peter Bala, Dec 10 2020

Crossrefs

Cf. A001107 (10-gonal numbers).
Column 6 of A195152.
Sequences of generalized k-gonal numbers: A001318 (k=5), A000217 (k=6), A085787 (k=7), A001082 (k=8), A118277 (k=9), this sequence (k=10), A195160 (k=11), A195162 (k=12), A195313 (k=13), A195818 (k=14), A277082 (k=15), A274978 (k=16), A303305 (k=17), A274979 (k=18), A303813 (k=19), A218864 (k=20), A303298 (k=21), A303299 (k=22), A303303 (k=23), A303814 (k=24), A303304 (k=25), A316724 (k=26), A316725 (k=27), A303812 (k=28), A303815 (k=29), A316729 (k=30).
Cf. sequences of the form m*(m+k)/(k+1) listed in A274978. [Bruno Berselli, Jul 25 2016]

Programs

  • Magma
    [n^2+n-1/4+(-1)^n/4+n*(-1)^n/2: n in [0..50]]; // Vincenzo Librandi, Sep 29 2013
    
  • Mathematica
    CoefficientList[Series[x(1 +6x +x^2)/((1-x)(1-x^2)^2), {x, 0, 50}], x] (* Vincenzo Librandi, Sep 29 2013 *)
    LinearRecurrence[{1,2,-2,-1,1}, {0,1,7,10,22}, 50] (* G. C. Greubel, Nov 07 2018 *)
  • PARI
    a(n)=(2*n+3-4*(n%2))*(n-n\2)
    
  • PARI
    concat([0],Vec(x*(1 + 6*x + x^2)/((1 - x)*(1 - x^2)^2) +O(x^50))) \\ Indranil Ghosh, Mar 16 2017
    
  • Python
    def A074377(n): return (n+1>>1)*((n<<1)+(-1 if n&1 else 3)) # Chai Wah Wu, Mar 11 2025

Formula

(n(n+1)-2)/4 where n(n+1)/2 is odd.
G.f.: x*(1+6*x+x^2)/((1-x)*(1-x^2)^2). - Michael Somos, Mar 04 2003
a(2*k) = k*(4*k+3); a(2*k+1) = (2*k+1)^2+k. - Benoit Jubin, Feb 05 2009
a(n) = n^2+n-1/4+(-1)^n/4+n*(-1)^n/2. - R. J. Mathar, Oct 08 2011
Sum_{n>=1} 1/a(n) = (4 + 3*Pi)/9. - Vaclav Kotesovec, Oct 05 2016
E.g.f.: exp(x)*x^2 + (2*exp(x) - exp(-x)/2)*x - sinh(x)/2. - Ilya Gutkovskiy, Mar 16 2017
Sum_{n>=1} (-1)^(n+1)/a(n) = 2*log(2) - 4/9. - Amiram Eldar, Feb 28 2022
a(n) = (n+1)*(2*n-1)/2 if n is odd and a(n) = n*(2*n+3)/2 if n is even. - Chai Wah Wu, Mar 11 2025

Extensions

New name from T. D. Noe, Apr 21 2006
Formula in sequence name from Omar E. Pol, May 28 2012

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

A035608 Expansion of g.f. x*(1 + 3*x)/((1 + x)*(1 - x)^3).

Original entry on oeis.org

0, 1, 5, 10, 18, 27, 39, 52, 68, 85, 105, 126, 150, 175, 203, 232, 264, 297, 333, 370, 410, 451, 495, 540, 588, 637, 689, 742, 798, 855, 915, 976, 1040, 1105, 1173, 1242, 1314, 1387, 1463, 1540, 1620, 1701, 1785, 1870, 1958, 2047, 2139, 2232, 2328, 2425, 2525, 2626
Offset: 0

Views

Author

Keywords

Comments

Maximum value of Voronoi's principal quadratic form of the first type when variables restricted to {-1,0,1}. - Michael Somos, Mar 10 2004
This is the main row of a version of the "square spiral" when read alternatively from left to right (see link). See also A001107, A007742, A033954, A033991. It is easy to see that the only prime in the sequence is 5. - Emilio Apricena (emilioapricena(AT)yahoo.it), Feb 08 2009
From Mitch Phillipson, Manda Riehl, Tristan Williams, Mar 06 2009: (Start)
a(n) gives the number of elements of S_2 \wr C_k that avoid the pattern 12, using the following ordering:
In S_j, a permutation p avoids a pattern q if it has no subsequence that is order-isomorphic to q. For example, p avoids the pattern 132 if it has no subsequence abc with a < c < b. We extend this notion to S_j \wr C_n as follows. Element psi =[ alpha_1^beta_1, ... alpha_j^beta_j ] avoids tau = [ a_1 ... a_m ] (tau in S_m) if psi' = [ alpha_1*beta_1 ... alpha_j*beta_j ] avoids tau in the usual sense. For n=2, there are 5 elements of S_2 \wr C_2 that avoid the pattern 12. They are: [ 2^1,1^1 ], [ 2^2,1^1 ], [ 2^2,1^2 ], [ 2^1,1^2 ], [ 1^2,2^1 ].
For example, if psi = [2^1,1^2], then psi'=[2,2] which avoids tau=[1,2] because no subsequence ab of psi' has a < b. (End)

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 115.

Crossrefs

Partial sums of A042948.
Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
Sequences on the four diagonals of the square spiral: Starting at 0: A002939 = 2*A000384, A016742 = 4*A000290, A002943 = 2*A014105, A033996 = 8*A000217; starting at 1: A054554, A053755, A054569, A016754.
Sequences obtained by reading alternate terms on the X and Y axes and the two main diagonals of the square spiral: Starting at 0: A035608, A156859, A002378 = 2*A000217, A137932 = 4*A002620; starting at 1: A317186, A267682, A002061, A080335.

Programs

  • Magma
    [n^2 + n - 1 - Floor((n-1)/2): n in [0..25]]; // G. C. Greubel, Oct 29 2017
  • Maple
    A035608:=n->floor((n + 1/4)^2): seq(A035608(n), n=0..100); # Wesley Ivan Hurt, Oct 29 2017
  • Mathematica
    Table[n^2 + Floor[n/2], {n, 0, 100}] (* Vladimir Joseph Stephan Orlovsky, Apr 12 2011 *)
    CoefficientList[Series[x (1 + 3 x)/((1 + x) (1 - x)^3), {x, 0, 60}], x] (* or *) LinearRecurrence[{2, 0, -2, 1}, {0, 1, 5, 10}, 60] (* Harvey P. Dale, Feb 21 2013 *)
  • PARI
    a(n)=n^2+n-1-(n-1)\2
    

Formula

a(n) = n^2 + n - 1 - floor((n-1)/2).
a(n) = A011848(2*n+1).
a(n) = A002378(n) - A004526(n+1). - Reinhard Zumkeller, Jan 27 2010
a(n) = 2*A006578(n) - A002378(n)/2 = A139592(n)/2. - Reinhard Zumkeller, Feb 07 2010
a(n) = A002265(n+2) + A173562(n). - Reinhard Zumkeller, Feb 21 2010
a(n) = floor((n + 1/4)^2). - Reinhard Zumkeller, Jan 27 2010
a(n) = (-1)^n*Sum_{i=0..n} (-1)^i*(2*i^2 + 3*i + 1). Omits the leading 0. - William A. Tedeschi, Aug 25 2010
a(n) = n^2 + floor(n/2), from Mathematica section. - Vladimir Joseph Stephan Orlovsky, Apr 12 2011
a(0)=0, a(1)=1, a(2)=5, a(3)=10; for n > 3, a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). - Harvey P. Dale, Feb 21 2013
For n > 1: a(n) = a(n-2) + 4*n - 3; see also row sums of triangle A253146. - Reinhard Zumkeller, Dec 27 2014
a(n) = 3*A002620(n) + A002620(n+1). - R. J. Mathar, Jul 18 2015
From Amiram Eldar, Mar 20 2022: (Start)
Sum_{n>=1} 1/a(n) = 4 - 2*log(2) - Pi/3.
Sum_{n>=1} (-1)^(n+1)/a(n) = 2*Pi/3 - 4*(1-log(2)). (End)
E.g.f.: (x*(2*x + 3)*cosh(x) + (2*x^2 + 3*x - 1)*sinh(x))/2. - Stefano Spezia, Apr 24 2024

A004524 Three even followed by one odd.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Ignoring the first term, for n >= 0, n/2 rounded by the method called "banker's rounding", "statistician's rounding", or "round-to-even" gives 0, 0, 1, 2, 2, 2, 3, ..., where this method rounds k + 0.5 to k if positive integer k is even but rounds k + 0.5 to k + 1 when k + 1 is even. (If the method is indeed defined such that the above statement is also true with the word "positive" removed, then the first 0 term need not be ignored and this sequence can be further extended symmetrically with a(m) = -a(-m) for all integers m, an advantage over usual rounding.) The corresponding sequence for n/2 rounded by the common method is A004526 (considered as beginning with n = -1). - Rick L. Shepherd, Nov 16 2006
From Anthony Hernandez, Aug 08 2016: (Start)
Arrange the positive integers starting at 1 into a triangular array
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 32 33 34 35 36
and let e(n) count the even numbers in the n-th row of the array. Then e(n) = a(n+1). For example, e(6) = a(7) = 3 and there are three even numbers in the 6th row of the array. For the count of odd numbers, f(n), look at the sequence A004525. (End)
Also the domination number of the (n-1) X (n-1) white bishop graph. - Eric W. Weisstein, Jun 26 2017
Let (b(n)) be the p-INVERT of A010892 using p(S) = 1 - S^2; then b(n) = a(n+1) for n >= 0. See A292301. - Clark Kimberling, Sep 30 2017
Also the total domination number of the (n-2)-complete graph (for n>3), (n-2)-cycle graph (for n>4), and (n-2)-pan graph (for n>4). - Eric W. Weisstein, Apr 07 2018
The sequence is the interleaving of the duplicated even integers (A052928) with the nonnegative integers (A001477). - Guenther Schrack, Mar 05 2019

Examples

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

Crossrefs

Zero followed by partial sums of A021913.
First differences of A011848.

Programs

  • GAP
    List([0..79],n->Int(n/4)+Int((n+1)/4)); # Muniru A Asiru, Mar 06 2019
    
  • Haskell
    a004524 n = n `div` 4 + (n + 1) `div` 4
    a004524_list = 0 : 0 : 0 : 1 : map (+ 2) a004524_list
    -- Reinhard Zumkeller, Feb 22 2013, Jul 14 2012
    
  • Magma
    [Floor(n/4)+Floor((n+1)/4) : n in [0..80]]; // Wesley Ivan Hurt, Jul 21 2014
    
  • Maple
    A004524:=n->floor(n/4)+floor((n+1)/4): seq(A004524(n), n=0..50); # Wesley Ivan Hurt, Jul 21 2014
  • Mathematica
    Table[Floor[n/4] + Floor[(n + 1)/4], {n, 0, 80}] (* Wesley Ivan Hurt, Jul 21 2014 *)
    Flatten[Table[{n, n, n, n + 1}, {n, 0, 38, 2}]] (* Alonso del Arte, Aug 10 2016 *)
    Table[(n + Cos[n Pi/2] - 1)/2, {n, 0, 80}] (* Eric W. Weisstein, Apr 07 2018 *)
    Table[Floor[n/2 - 1] + Ceiling[n/4 - 1/2] - Floor[n/4 - 1/2], {n, 0, 80}] (* Eric W. Weisstein, Apr 07 2018 *)
    LinearRecurrence[{2, -2, 2, -1}, {0, 0, 1, 2}, {0, 80}] (* Eric W. Weisstein, Apr 07 2018 *)
    CoefficientList[Series[x^3/((1 - x)^2 (1 + x^2)), {x, 0, 80}], x] (* Eric W. Weisstein, Apr 07 2018 *)
    Table[Round[(n - 1)/2], {n, 0, 20}] (* Eric W. Weisstein, Jun 19 2024 *)
    Round[(Range[0, 20] - 1)/2] (* Eric W. Weisstein, Jun 19 2024 *)
    Table[PadRight[{},If[EvenQ[n],3,1],n],{n,0,40}]//Flatten (* Harvey P. Dale, Dec 11 2024 *)
  • PARI
    {a(n) = n\4 + (n+1)\4}; /* Michael Somos, Jul 19 2003 */
    
  • PARI
    concat([0,0,0], Vec(x^3/((1-x)^2*(1+x^2)) + O(x^80))) \\ Altug Alkan, Oct 31 2015
    
  • Python
    def A004524(n): return (n>>2)+(n+1>>2) # Chai Wah Wu, Jul 29 2022
  • Sage
    [floor(n/4)+floor((n+1)/4) for n in (0..80)] # G. C. Greubel, Mar 08 2019
    

Formula

a(n) = a(n-1) - a(n-2) + a(n-3) + 1 = (n-1) - A004525(n-1). - Henry Bottomley, Mar 08 2000
G.f.: x^3/((1 - x)^2*(1 + x^2)) = x^3*(1 - x^2)/((1 - x)^2*(1 - x^4)). - Michael Somos, Jul 19 2003
If the sequence is extended to negative arguments in the natural way, it satisfies a(n) = -a(2-n) for all n in Z. - Michael Somos, Jul 19 2003
a(n) = A092038(n-3) for n > 4. - Reinhard Zumkeller, Mar 28 2004
From Paul Barry, Oct 27 2004: (Start)
E.g.f.: (exp(x)*(x-1) + cos(x))/2.
a(n) = (n - 1 - cos(Pi*(n-2)/2))/2. (End)
a(n+3) = Sum_{k = 0..n} (1 + (-1)^C(n,2))/2. - Paul Barry, Mar 31 2008
a(n) = floor(n/4) + floor((n+1)/4). - Arkadiusz Wesolowski, Sep 19 2012
From Wesley Ivan Hurt, Jul 21 2014, Oct 31 2015: (Start)
a(n) = Sum_{i = 1..n-1} (floor(i/2) mod 2).
a(n) = n/2 - sqrt(n^2 mod 8)/2. (End)
Euler transform of length 4 sequence [2, -1, 0, 1]. - Michael Somos, Apr 03 2017
a(n) = (2*n - 2 + (1 + (-1)^n)*(-1)^(n*(n-1)/2))/4. - Guenther Schrack, Mar 04 2019
Sum_{n>=3} (-1)^(n+1)/a(n) = log(2) (A002162). - Amiram Eldar, Sep 29 2022

A074378 Even triangular numbers halved.

Original entry on oeis.org

0, 3, 5, 14, 18, 33, 39, 60, 68, 95, 105, 138, 150, 189, 203, 248, 264, 315, 333, 390, 410, 473, 495, 564, 588, 663, 689, 770, 798, 885, 915, 1008, 1040, 1139, 1173, 1278, 1314, 1425, 1463, 1580, 1620, 1743, 1785, 1914, 1958, 2093, 2139, 2280, 2328, 2475
Offset: 0

Views

Author

W. Neville Holmes, Sep 04 2002

Keywords

Comments

Set of integers k such that k + (1 + 2 + 3 + 4 + ... + x) = 3*k, where x is sufficiently large. For example, 203 is a term because 203 + (1 + 2 + 3 + 4 + ... +28) = 609 and 609 = 3*203. - Gil Broussard, Sep 01 2008
Set of all m such that 16*m+1 is a perfect square. - Gary Detlefs, Feb 21 2010
Integers of the form Sum_{k=0..n} k/2. - Arkadiusz Wesolowski, Feb 07 2012
Numbers of the form h*(4*h + 1) for h = 0, -1, 1, -2, 2, -3, 3, ... - Bruno Berselli, Feb 26 2018
Numbers whose distance to nearest square equals their distance to nearest oblong; that is, numbers k such that A053188(k) = A053615(k). - Lamine Ngom, Oct 27 2020
The sequence terms are the exponents in the expansion of Product_{n >= 1} (1 - q^(8*n))*(1 + q^(8*n-3))*(1 + q^(8*n-5)) = 1 + q^3 + q^5 + q^14 + q^18 + .... - Peter Bala, Dec 30 2024

Crossrefs

Cf. A010709, A047522. [Vincenzo Librandi, Feb 14 2009]
Cf. A266883 (numbers n such that 16*n-15 is a square).

Programs

  • Magma
    f:=func; [0] cat [f(n*m): m in [-1,1], n in [1..25]]; // Bruno Berselli, Nov 13 2012
  • Maple
    a:=n->(2*n+1)*floor((n+1)/2): seq(a(n),n=0..50); # Muniru A Asiru, Feb 01 2019
  • Mathematica
    1/2 * Select[PolygonalNumber@ Range[0, 100], EvenQ] (* Michael De Vlieger, Jun 01 2017, Version 10.4 *)
    Select[Accumulate[Range[0,100]],EvenQ]/2 (* Harvey P. Dale, Feb 15 2025 *)
  • PARI
    a(n)=(2*n+1)*(n-n\2)
    

Formula

Sum_{n>=0} q^a(n) = (Prod_{n>0} (1-q^n))*(Sum_{n>=0} A035294(n)*q^n).
a(n) = n*(n + 1)/4 where n*(n + 1)/2 is even.
G.f.: x*(3 + 2*x + 3*x^2)/((1 - x)*(1 - x^2)^2).
From Benoit Jubin, Feb 05 2009: (Start)
a(n) = (2*n + 1)*floor((n + 1)/2).
a(2*k) = k*(4*k+1); a(2*k+1) = (k+1)*(4*k+3). (End)
a(2*n) = A007742(n), a(2*n-1) = A033991(n). - Arkadiusz Wesolowski, Jul 20 2012
a(n) = (4*n + 1 - (-1)^n)*(4*n + 3 - (-1)^n)/4^2. - Peter Bala, Jan 21 2019
a(n) = (2*n+1)*(n+1)*(1+(-1)^(n+1))/4 + (2*n+1)*(n)*(1+(-1)^n)/4. - Eric Simon Jacob, Jan 16 2020
From Amiram Eldar, Jul 03 2020: (Start)
Sum_{n>=1} 1/a(n) = 4 - Pi (A153799).
Sum_{n>=1} (-1)^(n+1)/a(n) = 6*log(2) - 4 (See A016687). (End)
a(n) = A014494(n)/2 = A274757(n)/3 = A266883(n) - 1. - Hugo Pfoertner, Dec 31 2024

A158405 Triangle T(n,m) = 1+2*m of odd numbers read along rows, 0<=m

Original entry on oeis.org

1, 1, 3, 1, 3, 5, 1, 3, 5, 7, 1, 3, 5, 7, 9, 1, 3, 5, 7, 9, 11, 1, 3, 5, 7, 9, 11, 13, 1, 3, 5, 7, 9, 11, 13, 15, 1, 3, 5, 7, 9, 11, 13, 15, 17, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23
Offset: 1

Author

Paul Curtz, Mar 18 2009

Keywords

Comments

Row sums are n^2 = A000290(n).
The triangle sums, see A180662 for their definitions, link this triangle of odd numbers with seventeen different sequences, see the crossrefs. The knight sums Kn14 - Kn110 have been added. - Johannes W. Meijer, Sep 22 2010
A208057 is the eigentriangle of A158405 such that as infinite lower triangular matrices, A158405 * A208057 shifts the latter, deleting the right border of 1's. - Gary W. Adamson, Feb 22 2012
T(n,k) = A099375(n-1,n-k), 1<=k<=n. [Reinhard Zumkeller, Mar 31 2012]

Examples

			The triangle contains the first n odd numbers in row n:
  1;
  1,3;
  1,3,5;
  1,3,5,7;
From _Seiichi Manyama_, Dec 02 2017: (Start)
    |       a(n)        |                               | A000290(n)
   -----------------------------------------------------------------
   0|                                                      (=  0)
   1|                 1 = 1/3 * ( 3)                       (=  1)
   2|             1 + 3 = 1/3 * ( 5 +  7)                  (=  4)
   3|         1 + 3 + 5 = 1/3 * ( 7 +  9 + 11)             (=  9)
   4|     1 + 3 + 5 + 7 = 1/3 * ( 9 + 11 + 13 + 15)        (= 16)
   5| 1 + 3 + 5 + 7 + 9 = 1/3 * (11 + 13 + 15 + 17 + 19)   (= 25)
(End)
		

Crossrefs

Triangle sums (see the comments): A000290 (Row1; Kn11 & Kn4 & Ca1 & Ca4 & Gi1 & Gi4); A000027 (Row2); A005563 (Kn12); A028347 (Kn13); A028560 (Kn14); A028566 (Kn15); A098603 (Kn16); A098847 (Kn17); A098848 (Kn18); A098849 (Kn19); A098850 (Kn110); A000217 (Kn21. Kn22, Kn23, Fi2, Ze2); A000384 (Kn3, Fi1, Ze3); A000212 (Ca2 & Ze4); A000567 (Ca3, Ze1); A011848 (Gi2); A001107 (Gi3). - Johannes W. Meijer, Sep 22 2010

Programs

  • Haskell
    a158405 n k = a158405_row n !! (k-1)
    a158405_row n = a158405_tabl !! (n-1)
    a158405_tabl = map reverse a099375_tabl
    -- Reinhard Zumkeller, Mar 31 2012
    
  • Mathematica
    Table[2 Range[1, n] - 1, {n, 12}] // Flatten (* Michael De Vlieger, Oct 01 2015 *)
  • PARI
    a(n) = 2*(n-floor((-1+sqrt(8*n-7))/2)*(floor((-1+sqrt(8*n-7))/2)+1)/2)-1;
    vector(100, n, a(n)) \\ Altug Alkan, Oct 01 2015

Formula

a(n) = 2*i-1, where i = n-t(t+1)/2, t = floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Feb 03 2013
a(n) = 2*A002262(n-1) + 1. - Eric Werley, Sep 30 2015

Extensions

Edited by R. J. Mathar, Oct 06 2009

A054925 a(n) = ceiling(n*(n-1)/4).

Original entry on oeis.org

0, 0, 1, 2, 3, 5, 8, 11, 14, 18, 23, 28, 33, 39, 46, 53, 60, 68, 77, 86, 95, 105, 116, 127, 138, 150, 163, 176, 189, 203, 218, 233, 248, 264, 281, 298, 315, 333, 352, 371, 390, 410, 431, 452, 473, 495, 518, 541, 564, 588, 613, 638, 663, 689, 716, 743, 770, 798
Offset: 0

Author

N. J. A. Sloane, May 24 2000

Keywords

Comments

Number of edges in "median" graph - gives positions of largest entries in rows of table in A054924.
Form the clockwise spiral starting 0,1,2,....; then A054925(n+1) interleaves 2 horizontal (A033951, A033991) and 2 vertical (A007742, A054552) branches. A bisection is A014848. - Paul Barry, Oct 08 2007
Consider the standard 4-dimensional Euclidean lattice. We take 1 step along the positive x-axis, 2 along the positive y-axis, 3 along the positive z-axis, 4 along the positive t-axis, and then back round to the x-axis. This sequence gives the floor of the Euclidean distance to the origin after n steps. - Jon Perry, Apr 16 2013
Jon Perry's JavaScript code is explained by A238604. - Michael Somos, Mar 01 2014
Ceiling of the area under the polygon connecting the lattice points (n, floor(n/2)) from 0..n. - Wesley Ivan Hurt, Jun 09 2014
Ceiling of one-half of each triangular number. - Harvey P. Dale, Oct 03 2016
For n > 2, also the edge cover number of the (n-1)-triangular honeycomb queen graph. - Eric W. Weisstein, Jul 14 2017
Conjecture: For n>11, there always exists a prime number p such that a(n)Raul Prisacariu, Sep 01 2024
For n = 1 up to at least n = 13, also the lower matching number of the triangular honeycomb bishop graph. - Eric W. Weisstein, Dec 13 2024
Conjecturally, apart from the first term, the sequence terms are the exponents in the expansion of Sum_{n >= 0} q^(3*n) * (Product_{k >= 2*n+1} 1 - q^k) = 1 - q - q^2 + q^3 + q^5 - q^8 - q^11 + + - - .... Cf. A039825. - Peter Bala, Apr 13 2025

Examples

			a(6) = 8; ceiling(6*(6-1)/4) = ceiling(30/4) = 8.
G.f. = x^2 + 2*x^3 + 3*x^4 + 5*x^5 + 8*x^6 + 11*x^7 + 14*x^8 + 18*x^9 + 23*x^10 + ...
		

Crossrefs

Programs

  • JavaScript
    p=new Array(0,0,0,0);
    for (a=0;a<100;a++) {
    p[a%4]+=a;
    document.write(Math.floor(Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]+p[3]*p[3]))+", ");
    } /* Jon Perry, Apr 16 2013 */
    
  • Magma
    [ Ceiling(n*(n-1)/4) : n in [0..50] ]; // Wesley Ivan Hurt, Jun 09 2014
    
  • Magma
    I:=[0,0,1,2,3]; [n le 5 select I[n] else 3*Self(n-1)-4*Self(n-2)+4*Self(n-3)-3*Self(n-4)+Self(n-5): n in [1..60]]; // Vincenzo Librandi, Jul 14 2015
  • Maple
    seq(ceil(binomial(n,2)/2), n=0..57); # Zerinvary Lajos, Jan 12 2009
  • Mathematica
    Table[Ceiling[(n^2 - n)/4], {n, 0, 20}] (* Wesley Ivan Hurt, Nov 01 2013 *)
    LinearRecurrence[{3, -4, 4, -3, 1}, {0, 0, 1, 2, 3}, 60] (* Vincenzo Librandi, Jul 14 2015 *)
    Join[{0}, Ceiling[#/2] &/ @ Accumulate[Range[0, 60]]] (* Harvey P. Dale, Oct 03 2016 *)
    Ceiling[Binomial[Range[0, 20], 2]/2] (* Eric W. Weisstein, Dec 13 2024 *)
    Table[Ceiling[Binomial[n, 2]/2], {n, 0, 20}] (* Eric W. Weisstein, Dec 13 2024 *)
    Table[(1 + (n - 1) n - Cos[n Pi/2] - Sin[n Pi/2])/4, {n, 0, 20}] (* Eric W. Weisstein, Dec 13 2024 *)
    CoefficientList[Series[x^2 (-1 + x - x^2)/((-1 + x)^3 (1 + x^2)), {x, 0, 20}], x] (* Eric W. Weisstein, Dec 13 2024 *)
  • PARI
    {a(n) = ceil( n * (n-1)/4)}; /* Michael Somos, Feb 11 2004 */
    
  • Sage
    [ceil(binomial(n,2)/2) for n in range(0,58)] # Zerinvary Lajos, Dec 01 2009
    

Formula

Euler transform of length 6 sequence [ 2, 0, 1, 1, 0, -1]. - Michael Somos, Sep 02 2006
From Michael Somos, Feb 11 2004: (Start)
G.f.: x^2 * (x^2 - x + 1) / ((1 - x)^3 * (1 + x^2)) = x^2 * (1 - x^6) / ((1 - x)^2 * (1 - x^3) * (1 - x^4)).
a(1-n) = a(n).
A011848(n) = a(-n). (End)
From Michael Somos, Mar 01 2014: (Start)
a(n + 4) = a(n) + 2*n + 3.
a(n+1) = floor( sqrt( A238604(n))). (End)
a(n) = A011848(n) + A133872(n+2). - Wesley Ivan Hurt, Jun 09 2014
Sum_{n>=2} 1/a(n) = 4 - Pi + 2*Pi*sinh(sqrt(7)*Pi/4)/(sqrt(7)*(1/sqrt(2)+cosh(sqrt(7)*Pi/4))). - Amiram Eldar, Dec 23 2024

A011857 Triangle of numbers [ C(n,k)/k ], k=1..n-1.

Original entry on oeis.org

2, 3, 1, 4, 3, 1, 5, 5, 3, 1, 6, 7, 6, 3, 1, 7, 10, 11, 8, 4, 1, 8, 14, 18, 17, 11, 4, 1, 9, 18, 28, 31, 25, 14, 5, 1, 10, 22, 40, 52, 50, 35, 17, 5, 1, 11, 27, 55, 82, 92, 77, 47, 20, 6, 1, 12, 33, 73, 123, 158, 154, 113, 61, 24, 6, 1, 13, 39, 95, 178, 257, 286, 245, 160
Offset: 2

Keywords

Crossrefs

Columns include A011848, A011849, A011850, A011851, A011852, A011853, A011854, A011855, A011856. Row sums are in A101687. Cf. A011847.

Programs

  • Mathematica
    Flatten[Table[Floor[Binomial[n,k]/k],{n,20},{k,n-1}]] (* Harvey P. Dale, Apr 19 2015 *)

A039823 a(n) = ceiling( (n^2 + n + 2)/4 ).

Original entry on oeis.org

1, 2, 4, 6, 8, 11, 15, 19, 23, 28, 34, 40, 46, 53, 61, 69, 77, 86, 96, 106, 116, 127, 139, 151, 163, 176, 190, 204, 218, 233, 249, 265, 281, 298, 316, 334, 352, 371, 391, 411, 431, 452, 474, 496, 518, 541, 565, 589, 613, 638, 664, 690, 716, 743, 771, 799, 827
Offset: 1

Keywords

Comments

Equals the number of different coefficient values in the expansion of Product_{i=1..n} (1 + q^1 + ... + q^i). Proof by Lawrence Sze: The Gaussian polynomial Prod_{k=1..n} Sum_{j=0..k} q^j is the q-version of n! and strictly unimodal with constant term 1. It has degree Sum_{k=1..n} k = n(n+1)/2, and thus n(n+1)/2+1 nonzero terms.
a(n) is equivalently the number of different absolute values obtained when summing the first n integers with all possible 2^n sign combinations. - Olivier Gérard, Mar 22 2010
Numbers in ascending order on the central axes (starting with 1) of Ulam's Spiral. - Bob Selcoe, Sep 25 2015

Examples

			Possible absolute values of sums of consecutive integers with any sign combination for n = 4 and n=5 are {0, 2, 4, 6, 8, 10} and {1, 3, 5, 7, 9, 11, 13, 15} respectively. - _Olivier Gérard_, Mar 22 2010
		

Crossrefs

Programs

  • Magma
    [Ceiling((n^2+n+2)/4) : n in [1..80]]; // Wesley Ivan Hurt, Sep 25 2015
    
  • Magma
    I:=[1,2,4,6,8]; [n le 5 select I[n] else 3*Self(n-1)-4*Self(n-2)+4*Self(n-3)-3*Self(n-4)+Self(n-5): n in [1..60]]; // Vincenzo Librandi, Sep 26 2015
  • Maple
    A039823:=n->ceil((n^2+n+2)/4): seq(A039823(n), n=1..100); # Wesley Ivan Hurt, Sep 25 2015
  • Mathematica
    Table[Floor[((n*(n+1)+2)/2+1)/2],{n,5!}] (* Vladimir Joseph Stephan Orlovsky, Apr 26 2010 *)
    LinearRecurrence[{3, -4, 4, -3, 1}, {1, 2, 4, 6, 8}, 70] (* Vincenzo Librandi, Sep 26 2015 *)
  • Maxima
    makelist((n*(n+1)+%i^(n*(n+1))+3)/4,n,1,57); /* Bruno Berselli, Jul 25 2012 */
    
  • PARI
    a(n) = ceil((n^2+n+2)/4);
    vector(80, n, a(n)) \\ Altug Alkan, Sep 25 2015
    

Formula

a(n) = floor(binomial(n+1, 2)/2) + 1 = A011848(n+1) + 1.
G.f.: x*(x^4-2*x^3+2*x^2-x+1)/((1+x^2)*(1-x)^3).
a(n) = (n*(n+1)+i^(n*(n+1))+3)/4, where i=sqrt(-1). - Bruno Berselli, Jul 25 2012
a(n) = a(n-1) + A004524(n+1). - Bob Selcoe, Sep 25 2015
a(n) = 3*a(n-1)-4*a(n-2)+4*a(n-3)-3*a(n-4)+a(n-5) for n>5. - Wesley Ivan Hurt, Sep 25 2015
a(n) = ceiling( (n^2+n+1)/4 ). - Bob Selcoe, Sep 26 2015

Extensions

Edited by Ralf Stephan, Nov 15 2004
Showing 1-10 of 29 results. Next