cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A337692 a(n) is the sum of all positive integers whose digits in base n are strictly decreasing.

This page as a plain text file.
%I A337692 #14 Jan 12 2021 09:06:37
%S A337692 0,3,40,495,6816,108255,1980672,41289759,968750080,25296994503,
%T A337692 728148203520,22912992806847,782690956959744,28847447610890415,
%U A337692 1141156999457800192,48228647947883167935,2168834125678237974528
%N A337692 a(n) is the sum of all positive integers whose digits in base n are strictly decreasing.
%H A337692 Reddit user blungbat, <a href="https://www.reddit.com/r/mathriddles/comments/it24bd/sum_of_numbers_with_descending_digits_ii/">Sum of numbers with descending digits II</a>, r/mathriddles, 2020.
%e A337692 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.
%p A337692 rebase := proc(digs,b)
%p A337692     add( op(i,digs)*b^(i-1),i=1..nops(digs)) ;
%p A337692 end proc:
%p A337692 A337692 := proc(b)
%p A337692     local a,digs,len,p ;
%p A337692     a := 0 ;
%p A337692     digs := [seq(i,i=0..b-1)] ;
%p A337692     for len from 1 to b do
%p A337692         for p in permute(digs,len) do
%p A337692             if op(-1,p) <> 0 and sort(p) = p then
%p A337692                 print(p) ;
%p A337692                 a := a+rebase(p,b) ;
%p A337692             end if;
%p A337692         end do:
%p A337692     end do:
%p A337692     print() ;
%p A337692     a ;
%p A337692 end proc:
%p A337692 seq(A337692(n),n=1..8) ; # _R. J. Mathar_, Nov 20 2020
%K A337692 nonn,base
%O A337692 1,2
%A A337692 _Jason Lang_, Sep 15 2020