On Fri, Dec 11, 2009 at 8:42 AM, Dan Bron <[email protected]> wrote:
> That is, provide a verb (roundest) such that with (roundestBase =. roundest
> N) then (roundestBase) is minimized and (roundestBase trailingZeros N) is
> maximized, where (trailingZeros =: [: +/ 0 *./\.@:= #.^:_1:). As an
> extension, given a list of positive integers, what is the smallest base in
> which the greatest amount of numbers from the list are round? That is,
> given (roundestBase =. roundest listOfN), then minimize (roundestBase) and
> maximize (+/ roundestBase trailingZeros"0 listOfN). I suppose this latter
> means roundestBase could either identify one really round number, or a bunch
> of less-round numbers.
I have not really deciphered this paragraph, but
roundestBase=: ({~ (i. >./))/@q:~&__
roundestBase 450
3
3 #.inv 450
1 2 1 2 0 0
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm