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.

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

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Apr 04 2023, following emails from Eric Angelini and Allan C. Wechsler

Keywords

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

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.
		

Crossrefs

See A361337 for the numbers that reach 0, and A361339 for the smallest k such that a(k) = n.
See also A361340-A361349.

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.