A361338 Number of different single-digit numbers that can be reached from n by any permissible sequence of split-and-multiply operations.
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, 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, 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
Offset: 0
Examples
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.
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.
Crossrefs
Programs
-
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 *)
-
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
-
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
Formula
a(n) = 1 for all n < 112. - M. F. Hasler, Apr 08 2023
Extensions
More than the usual number of terms are displayed in order to reach the first 3.
Comments