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-2 of 2 results.

A084265 a(n) = (n^2 + 3*n + 1 + (-1)^n) / 2.

Original entry on oeis.org

1, 2, 6, 9, 15, 20, 28, 35, 45, 54, 66, 77, 91, 104, 120, 135, 153, 170, 190, 209, 231, 252, 276, 299, 325, 350, 378, 405, 435, 464, 496, 527, 561, 594, 630, 665, 703, 740, 780, 819, 861, 902, 946, 989, 1035, 1080, 1128, 1175, 1225, 1274, 1326, 1377, 1431, 1484
Offset: 0

Views

Author

Paul Barry, May 31 2003

Keywords

Comments

Previous name was: Modified triangular numbers.
Binomial transform is A084266.
Partial sums give A064843. - N. J. A. Sloane, Jul 20 2008
Starting with "1" = triangle A171608 * the odd integers, (1, 3, 5, ...). - Gary W. Adamson, Dec 12 2009

Crossrefs

Programs

  • Magma
    [(n^2+3*n+1)/2+(-1)^n/2: n in [0..60]]; // Vincenzo Librandi, Aug 15 2013
    
  • Maple
    A084265:=n->(n^2+3*n+1)/2+(-1)^n/2: seq(A084265(n),n=0..100); # Wesley Ivan Hurt, Mar 21 2015
  • Mathematica
    CoefficientList[Series[(-1 - 2 x^2 + x^3) / ((1 + x) (x - 1)^3), {x, 0, 60}], x] (* Vincenzo Librandi, Aug 15 2013 *)
  • PARI
    vector(100,n,(n^2+n-1-(-1)^n)/2) \\ Derek Orr, Mar 22 2015

Formula

a(n) = A000217(n)+A059841(n)+n.
E.g.f.: cosh(x) + exp(x)*(2x+x^2/2).
a(n) = (n^2+3*n+1)/2+(-1)^n/2.
G.f.: ( -1-2*x^2+x^3 ) / ( (1+x)*(x-1)^3 ). - R. J. Mathar, Nov 26 2012
From Wesley Ivan Hurt, Mar 21 2015: (Start)
a(n) = 2*a(n-1)-2*a(n-3)+a(n-4).
a(n) = Sum_{i=0..n+1} i-(-1)^i. (End)
a(2*n) = A000384(n+1); a(2*n-1) = A014105(n)-1; a(2*n-1) = A014107(n+1), for all integers n. - Hartmut F. W. Hoft, Feb 02 2022

Extensions

New name from Joerg Arndt, Aug 15 2013

A064842 Maximal value of Sum_{i=1..n} (p(i) - p(i+1))^2, where p(n+1) = p(1), as p ranges over all permutations of {1, 2, ..., n}.

Original entry on oeis.org

0, 2, 6, 18, 36, 66, 106, 162, 232, 322, 430, 562, 716, 898, 1106, 1346, 1616, 1922, 2262, 2642, 3060, 3522, 4026, 4578, 5176, 5826, 6526, 7282, 8092, 8962, 9890, 10882, 11936, 13058, 14246, 15506, 16836, 18242, 19722, 21282, 22920, 24642, 26446, 28338, 30316
Offset: 1

Views

Author

N. J. A. Sloane, Oct 25 2001

Keywords

Examples

			a(4) = 18 because the values of the sum for the permutations of {1, 2, 3, 4} are 10 (8 times), 12 (8 times) and 18 (8 times).
		

Crossrefs

Cf. A064843.

Programs

  • Maple
    a:=proc(n) if n mod 2 = 0 then (n^3-4*n)/3+2 else (n^3-4*n)/3+1 fi end: seq(a(n),n=1..41); # Emeric Deutsch
  • Mathematica
    LinearRecurrence[{3, -2, -2, 3, -1}, {0, 2, 6, 18, 36}, 45] (* Jean-François Alcover, Apr 01 2020 *)

Formula

If n mod 2 = 0, then n^3/3 - 4*n/3 + 2 else n^3/3 - 4*n/3 + 1.
a(n) = 2 * A064843(n).
G.f.: -2*x^2*(-1 + x^3 - 2*x^2) / ((1 + x)*(x - 1)^4). - R. J. Mathar, Nov 26 2012
a(n) = (2*n^3 - 8*n + 3*(-1)^n + 9)/6. - Luce ETIENNE, Jul 08 2014
E.g.f.: (2 - x + x^2 + x^3/3)*cosh(x) + (1 - x + x^2 + x^3/3)*sinh(x) - 2. - Stefano Spezia, Apr 13 2024

Extensions

Edited by Emeric Deutsch, Jul 30 2005
Showing 1-2 of 2 results.