(Translated by https://www.hiragana.jp/)
A122461 - OEIS
login
A122461
Repetitions of even numbers four times.
3
0, 0, 0, 0, 2, 2, 2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8, 10, 10, 10, 10, 12, 12, 12, 12, 14, 14, 14, 14, 16, 16, 16, 16, 18, 18, 18, 18, 20, 20, 20, 20, 22, 22, 22, 22, 24, 24, 24, 24, 26, 26, 26, 26, 28, 28, 28, 28, 30, 30, 30, 30, 32, 32, 32, 32, 34, 34, 34, 34, 36, 36, 36, 36
OFFSET
0,5
COMMENTS
Number of roots of P(x) = 1 + x + x^2 + … + x^n in the right half-plane. - Michel Lagneau, Oct 30 2012
FORMULA
a(n) = (Sum_{k=0..n} (k+1)*cos((n-k)*Pi/2))+1/4*(2*cos(n*Pi/2)+1+(-1)^n)-2. - Paolo P. Lava, May 15 2007
a(n) = 2*A002265(n) = 2*A180969(2,n). [Adriano Caroli, Nov 25 2010, corrected by R. J. Mathar, Nov 26 2010]
G.f.: 2*x^4/(1-x-x^4+x^5). [Bruno Berselli, Oct 31 2012]
a(n) = (-3+(-1)^n+2*i^((n-1)*n)+2*n)/4, where i=sqrt(-1). [Bruno Berselli, Oct 31 2012]
a(n) = 2 * floor(n/4). - Wesley Ivan Hurt, Dec 06 2013
a(n) = (2*n-3+2*cos(n*Pi/2)+cos(n*Pi)+2*sin(n*Pi/2))/4. - Wesley Ivan Hurt, Oct 02 2017
MAPLE
with(numtheory): for n from 1 to 70 do:it:=0:y:=[fsolve(sum('x^i ', 'i'=0..n-1), x, complex)] : for m from 1 to nops(y) do : if Re(y[m]) > 0 then it:=it+1:else fi:od: printf(`%d, `, it):od: # Michel Lagneau, Oct 31 2012
A122461:=n->2*floor(n/4); seq(A122461(n), n=0..100); # Wesley Ivan Hurt, Dec 06 2013
MATHEMATICA
Table[2 Floor[n/4], {n, 0, 100}] (* Wesley Ivan Hurt, Dec 06 2013 *)
Table[PadRight[{}, 4, 2n], {n, 0, 20}]//Flatten (* or *) LinearRecurrence[ {1, 0, 0, 1, -1}, {0, 0, 0, 0, 2}, 80] (* Harvey P. Dale, Mar 15 2020 *)
PROG
(Python)
def A122461(n): return n>>1&-2 # Chai Wah Wu, Jan 30 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved