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!)
A031972 a(n) = Sum_{k=1..n} n^k. 10

%I #60 Dec 17 2023 13:42:49

%S 0,1,6,39,340,3905,55986,960799,19173960,435848049,11111111110,

%T 313842837671,9726655034460,328114698808273,11966776581370170,

%U 469172025408063615,19676527011956855056,878942778254232811937,41660902667961039785742,2088331858752553232964199

%N a(n) = Sum_{k=1..n} n^k.

%C Sum of lengths of longest ending contiguous subsequences with the same value over all s in {1,...,n}^n: a(n) = Sum_{k=1..n} k*A228273(n,k). a(2) = 6 = 2+1+1+2: [1,1], [1,2], [2,1], [2,2]. - _Alois P. Heinz_, Aug 19 2013

%C a(n) is the expected wait time to see the contiguous subword 11...1 (n copies of 1) over all infinite sequences on alphabet {1,2,...,n}. - _Geoffrey Critzer_, May 19 2014

%C a(n) is the number of sequences of k elements from {1,2,...,n}, where 1<=k<=n. For example, a(2) = 6, counting the sequences, [1], [2], [1,1], [1,2], [2,1], [2,2]. Equivalently, a(n) is the number of bar graphs having a height and width of at most n. - _Emeric Deutsch_, Jan 24 2017.

%C In base n, a(n) has n+1 digits: n 1's followed by a 0. - _Mathew Englander_, Oct 20 2020

%H Alois P. Heinz, <a href="/A031972/b031972.txt">Table of n, a(n) for n = 0..386</a>

%H A. Blecher, C. Brennan, A. Knopfmacher and H. Prodinger, <a href="http://dx.doi.org/10.1016/j.dam.2014.08.026">The height and width of bargraphs</a>, Discrete Applied Math. 180, (2015), 36-44.

%F a(1)=1; for n!=1 a(n) = (n^(n+1)-1)/(n-1) - 1. - _Benoit Cloitre_, Aug 17 2002

%F a(n) = A031973(n)-1 for n>0. - _Robert G. Wilson v_, Apr 15 2015

%F a(n) = n*A023037(n) = n^n - 1 + A023037(n). - _Mathew Englander_, Oct 20 2020

%p a:= n-> `if`(n<2, n, (n^(n+1)-n)/(n-1)):

%p seq(a(n), n=0..20); # _Alois P. Heinz_, Aug 15 2013

%t f[n_]:=Sum[n^k,{k,n}];Array[f,30] (* _Vladimir Joseph Stephan Orlovsky_, Feb 14 2011*)

%o (Haskell)

%o a031972 n = sum $ take n $ iterate (* n) n

%o -- _Reinhard Zumkeller_, Nov 22 2014

%o (Magma) [1] cat [(n^(n+1)-n)/(n-1): n in [2..20]]; // _Vincenzo Librandi_, Apr 16 2015

%Y Main diagonal of A228275.

%Y Cf. A031973, A228273, A023037, A226238.

%K nonn,easy

%O 0,3

%A _N. J. A. Sloane_, Dec 11 1999

%E a(0)=0 prepended by _Alois P. Heinz_, Oct 22 2019

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 April 19 12:06 EDT 2024. Contains 371792 sequences. (Running on oeis4.)