OFFSET
1,2
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..200
FORMULA
a(n) = (n+1)/2*((n+1)^n-1).
EXAMPLE
a(2) = 12[3] + 21[3] = 110[3] = 12[10] where [b] indicates the basis b in which the number is written;
a(3) = 123[4] + 231[4] + 312[4] = 126[10];
a(4) = 1234[5] + 2341[5] + 3412[5] + 4123[5] = 22220[5] = 1560[10],...
MAPLE
a:=proc(n) local b, m, i, s; b:=n+1: m:=add(i*b^(n-i), i=1..n): s:=m: for i to n-1 do m:=b^(n-1)*modp(m, b)+iquo(m, b): s:=s+m: od: s end; # or simply # a := n -> (n+1)/2*((n+1)^n-1)
MATHEMATICA
Table[((n+1)^n-1)*(n+1)/2, {n, 22}] (* Vladimir Joseph Stephan Orlovsky, Dec 28 2010 *)
PROG
(Magma) [((n + 1)^n - 1)*(n + 1) div 2: n in [1..20]]; // Vincenzo Librandi, Jan 09 2013
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
M. F. Hasler, Nov 07 2006
STATUS
approved