A371561 Numbers with multiplicative digital root of 5 that are free of 1s and have their digits in ascending order.
5, 35, 57, 355, 359, 557, 579, 3335, 3357, 5579, 5777, 33557, 35559, 333555, 357799, 557779, 3335779, 3355777, 33333577
Offset: 1
Programs
-
Mathematica
A031347 = Table[NestWhile[Times @@ IntegerDigits[#] &, n, # > 9 &], {n, 1, 100000}]; Select[Range[100000], A031347[[#]] == 5 && DigitCount[#, 10, 1] == 0 && Sort[IntegerDigits[#]] == IntegerDigits[#] &] (* Vaclav Kotesovec, Apr 17 2024 *)
-
Python
from math import prod from itertools import count, islice, combinations_with_replacement as mc def A031347(n): while n > 9: n = prod(map(int, str(n))) return n def bgen(): yield from (m for d in count(1) for m in mc((3,5,7,9), d)) def agen(): yield from (int("".join(map(str, t))) for t in bgen() if A031347(prod(t)) == 5) print(list(islice(agen(), 19))) # Michael S. Branicky, Apr 17 2024, edited Apr 18 2024 after Chai Wah Wu
-
Python
from math import prod from itertools import count, islice def A371561_gen(): # generator of terms for l in count(1): for a in range(l,-1,-1): a3 = 3**a for b in range(l-a,-1,-1): b3 = a3*5**b for c in range(l-a-b,-1,-1): d = l-a-b-c d3 = b3*7**c*9**d while d3 > 9: d3 = prod(int(x) for x in str(d3)) if d3==5: yield (10**(a+b+c+d)-1)//3+(10**d*(10**c*(10**b+1)+1)-3)*2//9 A371561_list = list(islice(A371561_gen(),19)) # Chai Wah Wu, Apr 17 2024
Comments