proposed
approved
proposed
approved
editing
proposed
a(1) = 2; for n > 1, a(n) = a(n-1) if n is already in the sequence, a(n) = a(n-1) + 4 otherwise.
a(n) = 2 + 4*(n - 2 - floor((n - 2)/4)).
a(n) = (6*n - (-1)^n + 2*sqrt(2)*sin(Pi*n/2 + Pi/4) - 5)/2. (End)
proposed
editing
editing
proposed
LinearRecurrence[{1, 0, 0, 1, -1}, {2, 2, 6, 10, 14}, 58] (* Jean-François Alcover, Jan 07 2019 *)
approved
editing
proposed
approved
editing
proposed
<a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,1,-1).
(PARI) a(n)=4*n - (n-2)\4*4 - 6 \\ Charles R Greathouse IV, Jul 17 2016
nonn,changed,easy
proposed
editing
editing
proposed