login
a(1) = 1; for n > 1, smallest digitally balanced number in base n.
23

%I #51 Apr 04 2024 10:00:35

%S 1,2,11,75,694,8345,123717,2177399,44317196,1023456789,26432593615,

%T 754777787027,23609224079778,802772380556705,29480883458974409,

%U 1162849439785405935,49030176097150555672,2200618769387072998445,104753196945250864004691,5271200265927977839335179

%N a(1) = 1; for n > 1, smallest digitally balanced number in base n.

%C A037968(a(n)) = n and A037968(m) < n for m < a(n). - _Reinhard Zumkeller_, Oct 27 2003

%C Also smallest pandigital number in base n. - _Franklin T. Adams-Watters_, Nov 15 2006

%H Reinhard Zumkeller, <a href="/A049363/b049363.txt">Table of n, a(n) for n = 1..250</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PandigitalNumber.html">Pandigital Number</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Pandigital_number">Pandigital number</a>

%H Chai Wah Wu, <a href="https://arxiv.org/abs/2403.20304">Pandigital and penholodigital numbers</a>, arXiv:2403.20304 [math.GM], 2024. See p. 1.

%F a(n) = (102345....n-1) in base n. - Ulrich Schimke (ulrschimke(AT)aol.com)

%F For n > 1, a(n) = (n^n-n)/(n-1)^2 + n^(n-2)*(n-1) - 1 = A023811(n) + A053506(n). - _Franklin T. Adams-Watters_, Nov 15 2006

%F a(n) = n^(n-1) + Sum_{m=2..n-1} m * n^(n - 1 - m). - _Alexander R. Povolotsky_, Sep 18 2022

%e a(6) = 102345_6 = 1*6^5 + 2*6^3 + 3*6^2 + 4*6^1 + 5*6^0 = 8345.

%p a:= n-> n^(n-1)+add((n-i)*n^(i-1), i=1..n-2):

%p seq(a(n), n=1..23); # _Alois P. Heinz_, May 02 2020

%t Table[FromDigits[Join[{1,0},Range[2,n-1]],n],{n,20}] (* _Harvey P. Dale_, Oct 12 2012 *)

%o (PARI) A049363(n)=n^(n-1)+sum(i=1,n-2,n^(i-1)*(n-i)) \\ _M. F. Hasler_, Jan 10 2012

%o (PARI) A049363(n)=if(n>1,(n^n-n)/(n-1)^2+n^(n-2)*(n-1)-1,1) \\ _M. F. Hasler_, Jan 12 2012

%o (Haskell)

%o a049363 n = foldl (\v d -> n * v + d) 0 (1 : 0 : [2..n-1])

%o -- _Reinhard Zumkeller_, Apr 04 2012

%o (Python)

%o def A049363(n): return (n**n-n)//(n-1)**2+n**(n-2)*(n-1)-1 if n>1 else 1 # _Chai Wah Wu_, Mar 13 2024

%Y Column k=1 of A061845 (for n>1).

%Y Cf. A031443, A049354, A049355, A023811.

%K nonn,base,nice

%O 1,2

%A _Harvey P. Dale_

%E More terms from Ulrich Schimke (ulrschimke(AT)aol.com)