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.

A035930 Maximal product of any two numbers whose concatenation is n.

This page as a plain text file.
%I A035930 #31 Oct 05 2021 22:00:42
%S A035930 0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,0,2,4,6,8,10,12,14,16,18,0,3,
%T A035930 6,9,12,15,18,21,24,27,0,4,8,12,16,20,24,28,32,36,0,5,10,15,20,25,30,
%U A035930 35,40,45,0,6,12,18,24,30,36,42,48,54,0,7,14,21,28,35,42,49,56,63,0,8,16,24,32,40,48,56,64,72,0,9,18,27,36,45,54,63,72,81,0,10,20,30,40,50,60,70
%N A035930 Maximal product of any two numbers whose concatenation is n.
%C A035930 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
%H A035930 Alois P. Heinz, <a href="/A035930/b035930.txt">Table of n, a(n) for n = 0..9999</a>
%H A035930 Eric Angelini, <a href="https://cinquantesignes.blogspot.com/2021/08/surface-of-number.html">Surface of a number</a>, Sep 01 2021.
%e A035930 a(341) = max(34*1,3*41) = 123.
%p A035930 a:= proc(n) local l, m; l:= convert(n, base, 10); m:= nops(l);
%p A035930       `if`(m<2, 0, max(seq(parse(cat(seq(l[m-i], i=0..j-1)))
%p A035930        *parse(cat(seq(l[m-i], i=j..m-1))), j=1..m)))
%p A035930     end:
%p A035930 seq(a(n), n=0..120);  # _Alois P. Heinz_, May 22 2009
%t A035930 Flatten[With[{c=Range[0,9]},Table[c*n,{n,0,10}]]] (* _Harvey P. Dale_, Jun 07 2012 *)
%o A035930 (Haskell)
%o A035930 a035930 n | n < 10    = 0
%o A035930           | otherwise = maximum $ zipWith (*)
%o A035930             (map read $ init $ tail $ inits $ show n)
%o A035930             (map read $ tail $ init $ tails $ show n)
%o A035930 -- _Reinhard Zumkeller_, Aug 14 2011
%o A035930 (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
%o A035930 (Python)
%o A035930 def a(n):
%o A035930     s = str(n)
%o A035930     return max((int(s[:i])*int(s[i:]) for i in range(1, len(s))), default=0)
%o A035930 print([a(n) for n in range(108)]) # _Michael S. Branicky_, Sep 01 2021
%Y A035930 Different from A007954, A088117, A171765 and A257297. Cf. A035931-A035935.
%K A035930 nonn,base,nice,look
%O A035930 0,13
%A A035930 _Erich Friedman_
%E A035930 An erroneous formula was deleted by _N. J. A. Sloane_, Dec 23 2008