login
A023811
Largest metadrome (number with digits in strict ascending order) in base n.
21
0, 1, 5, 27, 194, 1865, 22875, 342391, 6053444, 123456789, 2853116705, 73686780563, 2103299351334, 65751519677857, 2234152501943159, 81985529216486895, 3231407272993502984, 136146740744970718253, 6106233505124424657789, 290464265927977839335179
OFFSET
1,3
COMMENTS
Also smallest zeroless pandigital number in base n. - Franklin T. Adams-Watters, Nov 15 2006
The smallest permutational number in A134640 in the n-positional system. - Artur Jasinski, Nov 07 2007
LINKS
Chai Wah Wu, Pandigital and penholodigital numbers, arXiv:2403.20304 [math.GM], 2024. See p. 1.
FORMULA
a(n) = Sum_{j=1...n-1} j*n^(n-1-j).
lim_{n->infinity} a(n)/a(n-1) - a(n-1)/a(n-2) = exp(1). - Conjectured by Gerald McGarvey, Sep 26 2004. Follows from the formula below and lim_{n->infinity} (1+1/n)^n = e. - Franklin T. Adams-Watters, Jan 25 2010
a(n) = (n^n-n^2+n-1)/(n-1)^2 = A058128(n)-1 = n*A060073(n)-1 (for n>=2). - Henry Bottomley, Feb 21 2001
EXAMPLE
a(5) = 1234[5] (in base 5) = 1*5^3 + 2*5^2 + 3*5 + 4 = 125 + 50 + 15 + 4 = 194.
a(10) = 123456789 (in base 10).
MAPLE
0, seq((n^n-n^2+n-1)/(n-1)^2, n=2..100); # Robert Israel, Dec 13 2015
MATHEMATICA
Table[Total[(#1 n^#2) & @@@ Transpose@ {Range[n - 1], Reverse@ (Range[n - 1] - 1)}], {n, 20}] (* Michael De Vlieger, Jul 24 2015 *)
Table[Sum[(b - k)*b^(k - 1), {k, b - 1}], {b, 30}] (* Clark Kimberling, Aug 22 2015 *)
Table[FromDigits[Range[0, n - 1], n], {n, 20}] (* L. Edson Jeffery, Dec 13 2015 *)
PROG
(PARI) {for(i=1, 18, cuo=0; for(j=1, i-1, cuo=cuo+j*i^(i-j-1)); print1(cuo, ", "))} \\\ Douglas Latimer, May 16 2012
(PARI) A023811(n)=if(n>1, (n^n-n^2)\(n-1)^2+1) \\ M. F. Hasler, Jan 22 2013
(Magma) [0] cat [(n^n-n^2+n-1)/(n-1)^2: n in [2..20]]; // Vincenzo Librandi, May 22 2012
(Haskell)
a023811 n = foldl (\val dig -> val * n + dig) 0 [0 .. n - 1]
-- Reinhard Zumkeller, Aug 29 2014
(Python)
def a(n): return (n**n - n**2 + n - 1)//((n - 1)**2) if n > 1 else 0
print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Apr 24 2023
CROSSREFS
KEYWORD
nonn,easy,base
EXTENSIONS
Edited by M. F. Hasler, Jan 22 2013
STATUS
approved