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.

A028310 Expansion of (1 - x + x^2) / (1 - x)^2 in powers of x.

Original entry on oeis.org

1, 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, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71
Offset: 0

Views

Author

Keywords

Comments

1 followed by the natural numbers.
Molien series for ring of Hamming weight enumerators of self-dual codes (with respect to Euclidean inner product) of length n over GF(4).
Engel expansion of e (see A006784 for definition) [when offset by 1]. - Henry Bottomley, Dec 18 2000
Also the denominators of the series expansion of log(1+x). Numerators are A062157. - Robert G. Wilson v, Aug 14 2015
The right-shifted sequence (with a(0)=0) is an autosequence (of the first kind - see definition in links). - Jean-François Alcover, Mar 14 2017

Examples

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

Crossrefs

Cf. A000007, A000027, A000660 (boustrophedon transform).

Programs

  • Haskell
    a028310 n = 0 ^ n + n
    a028310_list = 1 : [1..]  -- Reinhard Zumkeller, Nov 06 2012
    
  • Magma
    [n eq 0 select 1 else n: n in [0..75]]; // G. C. Greubel, Jan 05 2024
    
  • Maple
    a:= n-> `if`(n=0, 1, n):
    seq(a(n), n=0..60);
  • Mathematica
    Denominator@ CoefficientList[Series[Log[1+x], {x,0,75}], x] (* or *)
    CoefficientList[ Series[(1 -x +x^2)/(1-x)^2, {x,0,75}], x] (* Robert G. Wilson v, Aug 14 2015 *)
    Join[{1}, Range[75]] (* G. C. Greubel, Jan 05 2024 *)
    LinearRecurrence[{2,-1},{1,1,2},80] (* Harvey P. Dale, Jan 29 2025 *)
  • PARI
    {a(n) = (n==0) + max(n, 0)} /* Michael Somos, Feb 02 2004 */
    
  • PARI
    A028310(n)=n+!n  \\ M. F. Hasler, Jan 16 2012
    
  • Python
    def A028310(n): return n|bool(n)^1 # Chai Wah Wu, Jul 13 2023
    
  • SageMath
    [n + int(n==0) for n in range(76)] # G. C. Greubel, Jan 05 2024

Formula

Binomial transform is A005183. - Paul Barry, Jul 21 2003
G.f.: (1 - x + x^2) / (1 - x)^2 = (1 - x^6) /((1 - x) * (1 - x^2) * (1 - x^3)) = (1 + x^3) / ((1 - x) * (1 - x^2)). a(0) = 1, a(n) = n if n>0.
Euler transform of length 6 sequence [ 1, 1, 1, 0, 0, -1]. - Michael Somos Jul 30 2006
G.f.: 1 / (1 - x / (1 - x / (1 + x / (1 - x)))). - Michael Somos, Apr 05 2012
G.f. of A112934(x) = 1 / (1 - a(0)*x / (1 - a(1)*x / ...)). - Michael Somos, Apr 05 2012
a(n) = A000027(n) unless n=0.
a(n) = Sum_{k=0..n} A123110(n,k). - Philippe Deléham, Oct 06 2009
E.g.f: 1+x*exp(x). - Wolfdieter Lang, May 03 2010
a(n) = sqrt(floor[A204503(n+3)/9]). - M. F. Hasler, Jan 16 2012
E.g.f.: 1-x + x*E(0), where E(k) = 2 + x/(2*k+1 - x/E(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Dec 24 2013
a(n) = A001477(n) + A000007(n). - Miko Labalan, Dec 12 2015 (See the first comment.)