OFFSET
1,1
FORMULA
Let T(n) be 1 if positive n is a triangular number, else 0; we also define T(0) as 0. Then we can also write this sequence as 1 + 4*n + 2*[T(1) + T(2) ... T(n-1)]. (Other than the special definition for T(0), T(n) is essentially A010054.)
The sequence can also be seen visually as
1 + 4
1 + 4 + 6
1 + 4 + 6 + 4
1 + 4 + 6 + 4 + 4
1 + 4 + 6 + 4 + 4 + 6
1 + 4 + 6 + 4 + 4 + 6 + 4
1 + 4 + 6 + 4 + 4 + 6 + 4 + 4
1 + 4 + 6 + 4 + 4 + 6 + 4 + 4 + 4
1 + 4 + 6 + 4 + 4 + 6 + 4 + 4 + 4 + 6...
MATHEMATICA
Module[{nn=60, tb}, tb=2*Accumulate[Table[If[IntegerQ[(Sqrt[8n+1]-1)/2], 1, 0], {n, nn}]]; Join[{5}, Table[1+4i+tb[[i-1]], {i, 2, nn}]]] (* Harvey P. Dale, Jul 22 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ed Smiley, Dec 23 2012
STATUS
approved