login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A068476 a(n) = Sum_{m=1..n} m*n^(m+(-1)^n). 1

%I #16 Sep 08 2022 08:45:05

%S 0,1,20,34,5008,3711,1948356,937924,1205220416,429794605,

%T 1098765432100,310989720966,1390027428561168,326011399456939,

%U 2332600912091693348,466937872906120456,5016202619581534249216,875711370981239308953

%N a(n) = Sum_{m=1..n} m*n^(m+(-1)^n).

%H Robert Israel, <a href="/A068476/b068476.txt">Table of n, a(n) for n = 0..385</a>

%F If n >= 2, a(n) = n^(1+(-1)^n)*(n^n*(n^2-n-1)+1)/(n-1)^2. - _Robert Israel_, Nov 15 2017

%e a(2) = 2^(1+1)+2*2^(2+1) = 4+16 = 20.

%p b := n->sum(m*n^(m+(-1)^n),m=1..n);

%p # Alternative:

%p f:= n -> n^(1+(-1)^n)*(n^n*(n^2-n-1)+1)/(n-1)^2:

%p f(0):= 0: f(1):= 1:

%p map(f, [$0..40]);

%t Table[Sum[m*n^(m+(-1)^n), {m,1,n}], {n,0,30}] (* _G. C. Greubel_, Oct 13 2018 *)

%o (PARI) a(n) = sum(m=1, n, m*n^(m+(-1)^n)); \\ _Michel Marcus_, Nov 15 2017

%o (Magma) [0] cat [(&+[m*n^(m+(-1)^n): m in [1..n]]): n in [1..30]]; // _G. C. Greubel_, Oct 13 2018

%Y Cf. A062806 (without the (-1)^n).

%K nonn

%O 0,3

%A Francois Jooste (phukraut(AT)hotmail.com), Mar 10 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 13:21 EDT 2024. Contains 371254 sequences. (Running on oeis4.)