OFFSET
1,2
LINKS
Reddit user blungbat, Sum of numbers with descending digits II, r/mathriddles, 2020.
EXAMPLE
In base n=3, a(3) is the sum of the base-3 numbers {1, 2, 10, 20, 21, 210}, which sum to 1+2+3+6+7+21 = 40.
MAPLE
rebase := proc(digs, b)
add( op(i, digs)*b^(i-1), i=1..nops(digs)) ;
end proc:
A337692 := proc(b)
local a, digs, len, p ;
a := 0 ;
digs := [seq(i, i=0..b-1)] ;
for len from 1 to b do
for p in permute(digs, len) do
if op(-1, p) <> 0 and sort(p) = p then
print(p) ;
a := a+rebase(p, b) ;
end if;
end do:
end do:
print() ;
a ;
end proc:
seq(A337692(n), n=1..8) ; # R. J. Mathar, Nov 20 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jason Lang, Sep 15 2020
STATUS
approved