Le Monde puzzle [#1139]
A weekly Monde current mathematical puzzle that reminded me of an earlier one (but was too lazy to check):
The integer n=36 enjoys the property that all the differences between its ordered divisors are also divisors of 36. Find the only 18≤m≤100 that enjoys this property such that all its prime dividers areof multiplicity one. Are there other such m’s?
The run of a brute force R search return 42 as the solution (codegolf welcomed!)
y=z=1:1e5 for(x in y)z[y==x]=!sum(x%%diff((1:x)[!x%%(1:x)])) y=y[z==1] for(k in generate_primes(2,max(y)))y=y[!!y%%k^2]
where generate_primes is a primes R function. Increasing the range of y’s to 10⁵ exhibits one further solution, 1806.
April 25, 2020 at 8:15 am
[…] article was first published on R – Xi'an's Og, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) […]
April 24, 2020 at 9:39 am
[…] by data_admin [This article was first published on R – Xi’an’s Og, and kindly contributed to R-bloggers]. (You can report issue about the content on this page […]