News for hackers. Stuff that matters.
Re:A happy numeric coincidence by Aardwolf on Wednesday January 02, 2019 @11:54AM (#18807591)
Neat, but why is for example 163^16 such a coincidence? It's not that unlikely for digits to add up to 163, and given that you can choose both a base and an exponent, there's bound to be many that work out like this. 163^16 has 36 digits, so expected sum (average expected value of a random digit 0-9 being 4.5) be 162. So that's even pretty close to 163.

Also, why limit this to base 10? Anything with base 10 digits is not the purest possible math imho because it depends on the arbitrary value 10 while you could generalize to any other value.

Re:A happy numeric coincidence by Aardwolf on Wednesday January 02, 2019 @12:18PM (#18807870)
You can speed up brute force search by starting somewhere before where log10(x^y) * 4.5 is roughly equal to x. For example 2222^140 is 2110 which is close to 2222. Then brute force search from there and you get:

2222 ^ 145

Re:A happy numeric coincidence by klodolph on Wednesday January 02, 2019 @03:09PM (#18809673)
How much does this speed up brute force search, though? You have to actually compute the exponent and digit sums. If I iterate over the powers of N from N^I to N^J, I do something like O((J-I)^2*log N) work doing multiplications the naive way.
Re:A happy numeric coincidence by Asooka on Thursday January 03, 2019 @06:16AM (#18814324)
Rewrite

    log(x^y)*4.5 = x
    y*log(x)*4.5 = x
    y = x/(4.5*log x)
So picking a random number like 234, we get y=21.94819 and the digit sum of 234^22 == 234. In this case we actually just had to compute one exponent and one digit sum.
Re:A happy numeric coincidence by klodolph on Thursday January 03, 2019 @10:34AM (#18815821)
Hint: try checking other numbers.
Re:A happy numeric coincidence by sephoric on Wednesday January 02, 2019 @03:51PM (#18810061)
I think one reason to limit to base 10 is because we don't have an arbitrary number of digits, we only have maybe 36 if we use the full alphabet. And it will be difficult for people to follow along with if it's something they aren't used to calculating in. But I'm also guessing the results will become a lot less "rare" which is part of the cool factor here.
Re:A happy numeric coincidence by enedil on Wednesday January 02, 2019 @06:46PM (#18811483)
Omg, you're not thinking he's done all this by hand, right? People here can code such simple things. And you don't need no specific symbols, just arrays of ints (or any suitable type).