How can I do simple tests like determining if an integer is a power of 2? Mathematically, the result below should be True, and I understand why it doesn't work on MMa, but how do I do this test properly so I'll get a correct result?
IntegerQ[Log[1024]/Log[2]]
False
IntegerQ@ PowerExpand[ Log[1024]/Log[2] ]– MarcoB Dec 19 '20 at 03:57IntegerQ[Log[1024]/Log[2] // FullSimplify]– Bob Hanlon Dec 19 '20 at 04:08IntegerQ[Log2[1024]]– Michael E2 Dec 19 '20 at 04:39FractionalPart[Log[SetAccuracy[6^1000, 1]]/Log[6]] == 0orStatistics`Library`RealIntegerQ[Log[SetAccuracy[6^1000, 1]]/Log[6]]will be fast for other bases. – Michael E2 Dec 19 '20 at 04:59MatchQ[IntegerDigits[1024, 2], {1, 0 ...}]also works. – AsukaMinato Dec 19 '20 at 09:24IntegerQ@Log[2,1024]. – Somos Dec 20 '20 at 02:55