Ruud H.G. van Tol on Sat, 07 Jan 2023 11:45:02 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: bnrL1 output ordering



On 2023-01-06 21:50, Bill Allombert wrote:
charall(c)=
{
   my(L=List());
   forvec(v=vector(#c,i,[0,c[i]-1]),listput(L,v));
   Vec(L);
}

Side-path:

https://en.wikipedia.org/wiki/Factorial_number_system

? [fromdigits(v)|v<-charall([3!,2!,1!])]
%=[0, 10, 100, 110, 200, 210, 300, 310, 400, 410, 500, 510]

? {
my
( d62= Vec("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxyz")
, d(v)= strjoin([d62[c+1]|c<-v])
);
[ d(v) | v <- charall([4!,3!,2!,1!]) ]
}

%=["0000", "0010", "0100", "0110", "0200", [...]
"M500", "M510", "N000", "N010", "N100", "N110", "N200",
"N210", "N300", "N310", "N400", "N410", "N500", "N510"]

-- Ruud