OFFSET
0,13
COMMENTS
Agrees up to a(100) = 0 with A088117, A171765 and A257297, but all of the four differ in a(101) and subsequent values. - M. F. Hasler, Sep 01 2021
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..9999
Eric Angelini, Surface of a number, Sep 01 2021.
EXAMPLE
a(341) = max(34*1,3*41) = 123.
MAPLE
a:= proc(n) local l, m; l:= convert(n, base, 10); m:= nops(l);
`if`(m<2, 0, max(seq(parse(cat(seq(l[m-i], i=0..j-1)))
*parse(cat(seq(l[m-i], i=j..m-1))), j=1..m)))
end:
seq(a(n), n=0..120); # Alois P. Heinz, May 22 2009
MATHEMATICA
Flatten[With[{c=Range[0, 9]}, Table[c*n, {n, 0, 10}]]] (* Harvey P. Dale, Jun 07 2012 *)
PROG
(Haskell)
a035930 n | n < 10 = 0
| otherwise = maximum $ zipWith (*)
(map read $ init $ tail $ inits $ show n)
(map read $ tail $ init $ tails $ show n)
-- Reinhard Zumkeller, Aug 14 2011
(PARI) apply( {A035930(n)=if(n>9, vecmax([vecprod(divrem( n, 10^j))|j<-[1..logint(n, 10)]]))}, [0..111]) \\ M. F. Hasler, Sep 01 2021
(Python)
def a(n):
s = str(n)
return max((int(s[:i])*int(s[i:]) for i in range(1, len(s))), default=0)
print([a(n) for n in range(108)]) # Michael S. Branicky, Sep 01 2021
CROSSREFS
KEYWORD
AUTHOR
EXTENSIONS
An erroneous formula was deleted by N. J. A. Sloane, Dec 23 2008
STATUS
approved