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.

A121626 Real part of (1 + n*i)^n, where i=sqrt(-1).

Original entry on oeis.org

1, 1, -3, -26, 161, 2876, -27755, -740536, 9722113, 343603216, -5707904499, -250756091552, 5039646554593, 264489160965056, -6237995487261915, -380574552503498624, 10303367499652761601, 716309568462681538816, -21891769059478538933603
Offset: 0

Views

Author

Gary W. Adamson, Aug 12 2006

Keywords

Examples

			a(4) = 161 since (1 + 4i)^4 = (161 - 240i).
		

Crossrefs

Cf. A115415.
Cf. A370189 (imaginary part).

Programs

  • Mathematica
    a[n_] := Re[(1 + n*I)^n]; Array[a, 18] (* Robert G. Wilson v, Aug 17 2006 *)
  • PARI
    a(n) = real((1 + n*I)^n); \\ Michel Marcus, Feb 14 2024
    
  • Python
    from math import comb
    def A121626(n): return sum(comb(n,j)*n**j*(-1 if j&2 else 1) for j in range(0,n+1,2)) # Chai Wah Wu, Feb 15 2024

Formula

a(n) = (1/2) * ( (i+n)^n + (i-n)^n ) * i^(n*(2*n+1)). - Bruno Berselli, Jan 28 2014
a(n) = Sum_{j=0..floor(n/2)} binomial(n,2j)*n^(2j)*(-1)^j. - Chai Wah Wu, Feb 15 2024

Extensions

More terms from Robert G. Wilson v, Aug 17 2006