Talk:Deceptive numbers: Difference between revisions

m
nine entries
m (Ocaml/Mathematical were already doing that last year)
m (nine entries)
Line 5:
 
Regarding the repunit '''R<sub>n-1</sub>''', the equation '''R<sub>n-1</sub> * 9 = 10<sup>n-1</sup> - 1''' is fulfilled. And if it is ensured, that '''n''' is not divisible by 3, then if '''R<sub>n-1</sub> * 9''' is divisible by '''n''', also '''R<sub>n-1</sub>''' is divisible by '''n'''. In that case, the check of '''R<sub>n-1</sub> mod n = 0''' can be simplified to '''10<sup>n-1</sup> mod n = 1''', which can be calculated via modular exponentiation, so that big integers are not required for this task.<br>
: Yep, that certainly works! (actually Ocaml/Mathematicanine entries were already doing just that last year) --[[User:Petelomax|Petelomax]] ([[User talk:Petelomax|talk]]) 23:52, 26 September 2023 (UTC)
With the [[wp:Fermat primality test]] being '''a<sup>n-1</sup> mod n = 1''', where '''[[gcd]](a, n) = 1''', it becomes obvious, that the ''deceptive numbers'' are a subset of the [[Fermat pseudoprimes]] to base '''a = 10''', with the multiples of 3 filtered out ('''10<sup>x</sup> - 1''' already rules out the multiples of 2 and 5). --[[User:Querfeld|Querfeld]] ([[User talk:Querfeld|talk]]) 19:09, 26 September 2023 (UTC)
7,806

edits