login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of different single-digit numbers that can be reached from n by any permissible sequence of split-and-multiply operations.
12

%I #57 Apr 08 2023 13:23:23

%S 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

%T 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

%U 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,1,2,1,1,2,2,2,1,2,2,2,2,1,1,2,2,2,2,2,2,2,3

%N Number of different single-digit numbers that can be reached from n by any permissible sequence of split-and-multiply operations.

%C We always split an integer into two integers, then multiply them (and iterate). For example, 2023 can be split into 20 and 23 (producing 20*23 = 460), or split into 202 and 3 (producing 202*3 = 606). The split 2 and 023 is forbidden, as 023 is not an integer (but 460 can be split into 46 and 0 as 0 is an integer).

%C The sequence is the number of different single-digit numbers that can be obtained from n by any sequence of splits and multiplications.

%C a(n) can take on any value from 1 to 10, inclusive. There are many obvious questions. Clearly (by induction), a(10*k) = 1, but are there arbitrarily large n with a(n) = 1 that are not multiples of 10? If not, what is the largest such n? - _Allan C. Wechsler_, Apr 04 2023

%C All numbers of the form m = (c)(0^i)(d) where c in 1..9, d in 1..9, i > 0 and juxtaposition/exponentiation are concatenation and repeated concatenation, resp., have a(m) = 1 since they lead only to 0 or multiples of 10. - _Michael S. Branicky_, Apr 07 2023

%H Michael De Vlieger, <a href="/A361338/b361338.txt">Table of n, a(n) for n = 0..17999</a>

%H Michael De Vlieger, <a href="/A361338/a361338_1.png">Plot of digit d in sequence S(n) in black at (x, y) = (n, d)</a> for n = 0..18000, d = 0..9, in blocks of 1000 arranged vertically from smallest at top to largest at bottom, 4X exaggeration. Digit 0 is most common, followed by {2, 4, 6, 8}, and then d = 5. Among reduced residues mod 10, d = 9 seems most common in this range.

%H Michael De Vlieger, <a href="/A361338/a361338_2.png">Plot of digit d in sequence S(n) in black at (x, y) = (n, d)</a> for n = 0..99999, d = 0..9, in rows of 1000 arranged vertically from smallest at top to largest at bottom, no exaggeration, no spacing between rows.

%F a(n) = 1 for all n < 112. - _M. F. Hasler_, Apr 08 2023

%e From 110 we can reach 11*0 = 0, or 1*10 = 10 -> 1*0 = 0, so we can only reach 0, and so a(110) = 1.

%e From 112 we can reach 11*2 = 22 -> 2*2 = 4, or 1*12 = 12 -> 1*2 = 2, so a(112) = 2.

%t Array[Count[Union@ Flatten[#], _?(# < 10 &)] &@

%t NestWhileList[Flatten@ Map[

%t Function[w,

%t Array[If[And[#[[-1, 1]] == 0, Length[#[[-1]]] > 1], Nothing,

%t Times @@ Map[FromDigits, #]] &@ TakeDrop[w, #] &,

%t Length[w] - 1]][IntegerDigits[#]] &, #] &, {#},

%t Length[#] > 0 &] &, 140, 0] (* _Michael De Vlieger_, Apr 04 2023 *)

%t (* Generate 100000 terms from linked image above *)

%t Flatten@ Array[Map[Total, Transpose@ ImageData[ColorNegate@ Import["https://oeis.org/A361338/a361338_2.png", "PNG"], "Bit"][[10 # + 1 ;; 10 # + 10, 1 ;; 1000]]] &, 100, 0] (* _Michael De Vlieger_, Apr 06 2023 *)

%o (Python)

%o from functools import lru_cache

%o @lru_cache(maxsize=None)

%o def f(n):

%o if n < 10: return {n}

%o s = str(n)

%o return {e for i in range(1, len(s)) if s[i]!="0" or i==len(s)-1 for e in f(int(s[:i])*int(s[i:]))}

%o def A361338(n):

%o return len(f(n))

%o print([A361338(n) for n in range(140)]) # _Michael S. Branicky_, Apr 04 2023

%o (PARI) A361338(n, set=0)=if(!set, #A361338(n, 1), n<20, [n%10], Set(concat([A361338(vecprod(divrem(n,10^p)), 1)| p<-[1..logint(n,10)],p==1||n\10^(p-1)%10]))) \\ _M. F. Hasler_, Apr 08 2023

%Y See A361337 for the numbers that reach 0, and A361339 for the smallest k such that a(k) = n.

%Y See also A361340-A361349.

%K nonn,base

%O 0,113

%A _N. J. A. Sloane_, Apr 04 2023, following emails from _Eric Angelini_ and _Allan C. Wechsler_

%E More than the usual number of terms are displayed in order to reach the first 3.