%I #70 Oct 04 2024 11:19:01
%S 0,1,3,13,85,781,9331,137257,2396745,48427561,1111111111,28531167061,
%T 810554586205,25239592216021,854769755812155,31278135027204241,
%U 1229782938247303441,51702516367896047761,2314494592664502210319,109912203092239643840221
%N a(n) = n^0 + n^1 + ... + n^(n-1), or a(n) = (n^n-1)/(n-1) with a(0)=0; a(1)=1.
%C For prime n, a(n) is conjectured to be the period of Bell numbers (mod n). See A054767. - _T. D. Noe_, Oct 12 2007
%C For prime n, a(n) is a multiple of the period of Bell numbers mod n (and conjectured to be exactly the period, as mentioned above). - _Charles R Greathouse IV_, Jul 31 2012
%C For n >= 1, a(n) is the number whose base n representation is a string of n ones. For example, 11111 in base 5 is a(5) = 781. - _Melvin Peralta_, May 23 2016
%C For n > 0, n^(a(n)-1) == 1 (mod a(n)), so for n > 1, a(n) is a prime or a Fermat pseudoprime to base n. - _Thomas Ordowski_, Mar 15 2021
%H Alois P. Heinz, <a href="/A023037/b023037.txt">Table of n, a(n) for n = 0..387</a> (first 101 terms from T. D. Noe)
%H Carlos M. da Fonseca and Anthony G. Shannon, <a href="https://doi.org/10.7546/nntdm.2024.30.3.491-498">A formal operator involving Fermatian numbers</a>, Notes Num. Theor. Disc. Math. (2024) Vol. 30, No. 3, 491-498.
%H W. F. Lunnon et al., <a href="http://matwbn.icm.edu.pl/ksiazki/aa/aa35/aa3511.pdf">Arithmetic properties of Bell numbers to a composite modulus I</a>, Acta Arith., 35 (1979), 1-16.
%F a(n) = A125118(n,n-1) for n>1. - _Reinhard Zumkeller_, Nov 21 2006
%F a(n) = [x^n] x/((1 - x)*(1 - n*x)). - _Ilya Gutkovskiy_, Oct 04 2017
%e a(3) = 3^0 + 3^1 + 3^2 = 1+3+9 = 13.
%p A023037:=n->add(n^i, i=0..n-1): seq(A023037(n), n=0..25); # _Wesley Ivan Hurt_, May 28 2016
%t Join[{0,1},Table[(n^n-1)/(n-1),{n,2,20}]] (* _Harvey P. Dale_, Aug 01 2014 *)
%o (Sage) [lucas_number1(n,n+1,n) for n in range(0, 19)] # _Zerinvary Lajos_, May 16 2009
%o (PARI) a(n) = if(n==1, 1, (n^n-1)/(n-1)); \\ _Altug Alkan_, Oct 04 2017
%o (Python)
%o def A023037(n): return (n**n-1)//(n-1) if n>1 else n # _Chai Wah Wu_, Sep 28 2023
%Y Cf. A001039, A054767, A088790 (n such that a(n) is prime), A125118.
%K nonn,easy
%O 0,3
%A _David W. Wilson_
%E Entry improved by Tobias Nipkow (nipkow(AT)in.tum.de).