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.

A000463 n followed by n^2.

Original entry on oeis.org

1, 1, 2, 4, 3, 9, 4, 16, 5, 25, 6, 36, 7, 49, 8, 64, 9, 81, 10, 100, 11, 121, 12, 144, 13, 169, 14, 196, 15, 225, 16, 256, 17, 289, 18, 324, 19, 361, 20, 400, 21, 441, 22, 484, 23, 529, 24, 576, 25, 625, 26, 676, 27, 729, 28, 784, 29, 841, 30, 900, 31, 961, 32, 1024, 33, 1089, 34, 1156, 35, 1225, 36, 1296
Offset: 1

Views

Author

Keywords

Comments

Eigensequence of a triangle with nonnegative integers interlaced with zeros (1, 0, 2, 0, 3, ...) as the right and left borders, with the rest zeros. - Gary W. Adamson, Aug 01 2016

Examples

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

Crossrefs

Cf. A188652 (first differences), A188653 (second differences), A159693 (partial sums), A000290 (squares).

Programs

  • Haskell
    a000463 n = a000463_list !! (n-1)
    a000463_list = concatMap (\x -> [x,x^2]) [1..]
    -- Reinhard Zumkeller, Apr 13 2011
    
  • Magma
    &cat[ [ n, n^2 ]: n in [1..36] ]; // Klaus Brockhaus, Apr 20 2009
    
  • Maple
    seq(seq(n^k, k=1..2), n=1..36); # Zerinvary Lajos, Jun 29 2007
  • Mathematica
    Array[{#, #^2} &, 36, 0] // Flatten
    Riffle[Range[40], Range[40]^2] (* Bruno Berselli, Jul 15 2013 *)
    a[ n_] := If[ OddQ @ n, (n + 1) / 2, n^2 / 4]; (* Michael Somos, May 28 2014 *)
  • PARI
    {a(n) = if( n%2, (n + 1) / 2, n^2 / 4)}; /* Michael Somos, May 28 2014 */

Formula

a(n) = ((((-1)^(n+1))+1)/4)(n+1) - ((((-1)^(n+1))-1)/8)n^2 - Sam Alexander
G.f.: (1+x-x^2+x^3)/((1-x)^3(1+x)^3).
a(n) = if(n mod 2, (n+1)/2, (n/2)^2). - Gerald Hillier, Sep 25 2008
a(n) = floor((n+1) / 2) ^ (2 - n mod 2). - Reinhard Zumkeller, Aug 15 2011
E.g.f.: (x + 2)*(sinh(x) + x*cosh(x))/4. - Ilya Gutkovskiy, Aug 02 2016

Extensions

Square of 14 corrected by Sean A. Irvine, Oct 25 2010