Sum-product number
A sum-product number in a given number base formula_1 is a natural number that is equal to the product of the sum of its digits and the product of its digits. There are a finite number of sum-product numbers in any given base formula_1. In base 10, there are exactly four sum-product numbers : 0, 1, 135, and 144. Definition. Let formula_3 be a natural number. We define the sum-product function for base formula_4 formula_5 to be the following: where formula_7 is the number of digits in the number in base formula_1, and is  the value of each digit of the number. A natural number formula_3 is a sum-product number if it is a fixed point for formula_11, which occurs if formula_12. The natural numbers 0 and 1 are trivial sum-product numbers for all formula_1, and all other sum-product numbers are nontrivial sum-product numbers. For example, the number 144 in base 10 is a sum-product number, because formula_14, formula_15, and formula_16. A natural number formula_3 is a sociable sum-product number if it is a periodic point for formula_11, where formula_19 for a positive integer formula_20, and forms a  cycle of period formula_20. A sum-product number is a sociable sum-product number with formula_22, and a amicable sum-product number is a sociable sum-product number with formula_23. All natural numbers formula_3 are preperiodic points for formula_11, regardless of the base. This is because for any given digit count formula_26, the minimum possible value of formula_3 is formula_28 and the maximum possible value of formula_3 is formula_30. The maximum possible digit sum is therefore formula_31 and the maximum possible digit product is formula_32. Thus, the sum-product function value is formula_33. This suggests that formula_34, or dividing both  sides by formula_35, formula_36. Since formula_37, this means that there will be a maximum value formula_26 where formula_39, because of the exponential nature of formula_40 and the linearity of formula_41. Beyond this value formula_26, formula_43 always. Thus, there are a finite number of sum-product numbers, and any natural number is guaranteed to reach a periodic point or a fixed point less than formula_44, making it a preperiodic point. The number of iterations formula_45 needed for formula_46 to reach a fixed point is the sum-product function's persistence of formula_3, and undefined if it never reaches a fixed point . Any integer shown to be a sum-product number in a given base must, by definition, also be a Harshad number in that base. Sum-product numbers and cycles of "F" for specific "b". All numbers are represented in base formula_1. Extension to negative integers. Sum-product numbers can be extended to the negative integers by use of a signed-digit representation to represent each integer. Programming example. The example below implements the sum-product function described in the definition above to search for sum-product numbers and cycles in Python. def sum_product(x: int, b: int) -> int: def sum_product_cycle(x : int, b: int) -> list[int]: