20
A cyclic number is a number of "n" digits that when multiplied by 1, 2, 3,...n, results in the same digits but in a different order.
For example, the number 142,857 is a cyclic number since 142,857 x 2 = 285,714, 142,857 x 3 = 428,571, 142,857 x 4 = 571,428, and so on. Given an integer input, determine if it is a cyclic number by outputting a truthy value if it is, and a falsy value if not.
Also, to be clear, the input can contain leading 0's: e.g. 0344827586206896551724137931
This is because, if leading zeros are not permitted on numerals, then 142857 is the only cyclic number in decimal.
Since it is code-golf, shortest answer in bytes wins!
1
Hi and welcome to PPCG. This is not a bad question, but if you take a look at some of the recently posted questions I think that you will see that it could be better. Specifically, it would be very beneficial for the community if you provided more test cases to work with. When posting future challenges, please consider using the sandbox.
– FryAmTheEggman – 2017-05-29T00:06:42.067