login
A337692
a(n) is the sum of all positive integers whose digits in base n are strictly decreasing.
1
0, 3, 40, 495, 6816, 108255, 1980672, 41289759, 968750080, 25296994503, 728148203520, 22912992806847, 782690956959744, 28847447610890415, 1141156999457800192, 48228647947883167935, 2168834125678237974528
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
Sequence in context: A002700 A220639 A355373 * A331795 A005724 A215196
KEYWORD
nonn,base
AUTHOR
Jason Lang, Sep 15 2020
STATUS
approved