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.

A274681 Numbers k such that 4*k + 1 is a triangular number.

Original entry on oeis.org

0, 5, 11, 26, 38, 63, 81, 116, 140, 185, 215, 270, 306, 371, 413, 488, 536, 621, 675, 770, 830, 935, 1001, 1116, 1188, 1313, 1391, 1526, 1610, 1755, 1845, 2000, 2096, 2261, 2363, 2538, 2646, 2831, 2945, 3140, 3260, 3465, 3591, 3806, 3938, 4163, 4301, 4536
Offset: 1

Views

Author

Colin Barker, Jul 02 2016

Keywords

Comments

Also, numbers of the form m*(8*m + 3) for m = 0, -1, 1, -2, 2, -3, 3, ... - Bruno Berselli, Feb 26 2018

Examples

			5 is in the sequence since 4*5 + 1 = 21 is a triangular number (21 = 1 + 2 + 3 + 4 + 5 + 6). - _Michael B. Porter_, Jul 03 2016
		

Crossrefs

Cf. A000217, A000096 (n+1), A074377 (2*n+1), A045943 (3*n+1), A085787 (5*n+1).
Cf. A057029.
Cf. similar sequences listed in A299645.

Programs

  • Magma
    [(1-(-1)^n+2*(-4+(-1)^n)*n+8*n^2)/4: n in [1..80]]; // Wesley Ivan Hurt, Jul 02 2016
    
  • Maple
    A274681:=n->(1-(-1)^n+2*(-4+(-1)^n)*n+8*n^2)/4: seq(A274681(n), n=1..100); # Wesley Ivan Hurt, Jul 02 2016
  • Mathematica
    Rest@ CoefficientList[Series[x^2 (5 + 6 x + 5 x^2)/((1 - x)^3 (1 + x)^2), {x, 0, 48}], x] (* Michael De Vlieger, Jul 02 2016 *)
    Select[Range[0,5000],OddQ[Sqrt[8(4#+1)+1]]&] (* or *) LinearRecurrence[ {1,2,-2,-1,1},{0,5,11,26,38},50] (* Harvey P. Dale, Apr 21 2018 *)
  • PARI
    isok(n) = ispolygonal(4*n+1, 3)
    
  • PARI
    select(n->ispolygonal(4*n+1, 3), vector(10000, n, n-1))
    
  • PARI
    concat(0, Vec(x^2*(5+6*x+5*x^2)/((1-x)^3*(1+x)^2) + O(x^100)))
    
  • Python
    def A274681(n): return (n>>1)*((n<<2)+(-1 if n&1 else -3)) # Chai Wah Wu, Mar 11 2025

Formula

G.f.: x^2*(5 + 6*x + 5*x^2) / ((1 - x)^3*(1 + x)^2).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>5.
a(n) = A057029(n) - 1.
a(n) = (1 - (-1)^n + 2*(-4 + (-1)^n)*n + 8*n^2)/4.
a(n) = (4*n^2 - 3*n)/2 for n even, a(n) = (4*n^2 - 5*n + 1)/2 for n odd.