OFFSET
0,113
COMMENTS
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).
The sequence is the number of different single-digit numbers that can be obtained from n by any sequence of splits and multiplications.
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
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
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..17999
Michael De Vlieger, Plot of digit d in sequence S(n) in black at (x, y) = (n, d) 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.
Michael De Vlieger, Plot of digit d in sequence S(n) in black at (x, y) = (n, d) 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.
FORMULA
a(n) = 1 for all n < 112. - M. F. Hasler, Apr 08 2023
EXAMPLE
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.
From 112 we can reach 11*2 = 22 -> 2*2 = 4, or 1*12 = 12 -> 1*2 = 2, so a(112) = 2.
MATHEMATICA
Array[Count[Union@ Flatten[#], _?(# < 10 &)] &@
NestWhileList[Flatten@ Map[
Function[w,
Array[If[And[#[[-1, 1]] == 0, Length[#[[-1]]] > 1], Nothing,
Times @@ Map[FromDigits, #]] &@ TakeDrop[w, #] &,
Length[w] - 1]][IntegerDigits[#]] &, #] &, {#},
Length[#] > 0 &] &, 140, 0] (* Michael De Vlieger, Apr 04 2023 *)
(* Generate 100000 terms from linked image above *)
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 *)
PROG
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
def f(n):
if n < 10: return {n}
s = str(n)
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:]))}
def A361338(n):
return len(f(n))
print([A361338(n) for n in range(140)]) # Michael S. Branicky, Apr 04 2023
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
More than the usual number of terms are displayed in order to reach the first 3.
STATUS
approved