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.

A271624 a(n) = 2*n^2 - 4*n + 4.

Original entry on oeis.org

2, 4, 10, 20, 34, 52, 74, 100, 130, 164, 202, 244, 290, 340, 394, 452, 514, 580, 650, 724, 802, 884, 970, 1060, 1154, 1252, 1354, 1460, 1570, 1684, 1802, 1924, 2050, 2180, 2314, 2452, 2594, 2740, 2890, 3044, 3202, 3364, 3530, 3700, 3874, 4052, 4234, 4420, 4610, 4804, 5002, 5204, 5410, 5620
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 11 2016

Keywords

Comments

Numbers n such that 2*n - 4 is a perfect square.
For n > 2, the number of square a(n)-gonal numbers is finite. - Muniru A Asiru, Oct 16 2016

Examples

			a(1) = 2*1^2 - 4*1 + 4 = 2.
		

Crossrefs

Cf. A002522, numbers n such that 2*n + k is a perfect square: no sequence (k = -9), A255843 (k = -8), A271649 (k = -7), A093328 (k = -6), A097080 (k = -5), this sequence (k = -4), A051890 (k = -3), A058331 (k = -2), A001844 (k = -1), A001105 (k = 0), A046092 (k = 1), A056222 (k = 2), A142463 (k = 3), A054000 (k = 4), A090288 (k = 5), A268581 (k = 6), A059993 (k = 7), (-1)*A147973 (k = 8), A139570 (k = 9), A271625 (k = 10), A222182 (k = 11), A152811 (k = 12), A181510 (k = 13), A161532 (k = 14), no sequence (k = 15).

Programs

  • Magma
    [ 2*n^2 - 4*n + 4: n in [1..60]];
    
  • Magma
    [ n: n in [1..6000] | IsSquare(2*n-4)];
    
  • Mathematica
    Table[2 n^2 - 4 n + 4, {n, 54}] (* Michael De Vlieger, Apr 11 2016 *)
    LinearRecurrence[{3,-3,1},{2,4,10},60] (* Harvey P. Dale, Jul 18 2023 *)
  • PARI
    x='x+O('x^99); Vec(2*x*(1-x+2*x^2)/(1-x)^3) \\ Altug Alkan, Apr 11 2016
    
  • PARI
    a(n)=2*n^2-4*n+4 \\ Charles R Greathouse IV, Apr 11 2016

Formula

a(n) = 2*A002522(n-1).
G.f.: 2*x*(1 - x + 2*x^2)/(1 - x)^3. - Ilya Gutkovskiy, Apr 11 2016
Sum_{n>=1} 1/a(n) = (1 + Pi*coth(Pi))/4 = 1.038337023734290587067... . - Vaclav Kotesovec, Apr 11 2016
a(n) = A005893(n-1), n > 1. - R. J. Mathar, Apr 12 2016
a(n) = 2 + 2*(n-1)^2. - Tyler Skywalker, Jul 21 2016
From Elmo R. Oliveira, Nov 17 2024: (Start)
E.g.f.: 2*(exp(x)*(x^2 - x + 2) - 2).
a(n) = 2*A160457(n).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 3. (End)