Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I had a headslap moment right after posting, my apologies.
Because
2 ** 2 % 8 == 4
. But it should be0
.Why should testing f(8) return 4 instead of 2?
I'm sorry, for clarity, are my equations the problem? They are not a solution that worked for me, simply an approach I tried before finding one that did. However, if that is the issue I will mark it.
Thanks for letting me know.
guys... there are no spoiler flags here...
Thank you again for taking the time to share these resources with me, I am finishing my BaS in Secure Software Development, and the focus on security methodologies, development lifecycles, and all the fun stuff associated with that path has me polishing my own discrete mathmatics skills and I'm working through the open MIT pre-req's right now. I'm always amazed at how interesting math is when approached correctly versus the embarrasment that was my primary school days.
Best of luck and I hope I see you around the boards.
Here is some explanations regarding the equation you mention: https://math.stackexchange.com/questions/192720/automorphic-numbers
Fantastic explanation!
Thank you for taking the time to explain that as well as to introduce me to the concept of attractors, I actually tried a multithreaded approach with itterative equations that was less elegant, attractors is the perfect solution to the issues I was having there. My equations looked like the this.
This comment is hidden because it contains spoiler information about the solution
Thanks!
I like your approach; it's much more Pythonic, scaleable, and elegant also - for me, I used this kata as an opportunity to learn about these numbers, so my approach is basically just a copy of my "reading notes" as I worked through the various articles/web pages!
I like the quality of the comments, It helps demonstrate the multiple approaches that are possible. I attempted a multithreaded solution similair in the beginning and ran into issues with the limits of string length and int conversion.
This problem has two attractors
f
ands
for each magnitude of ten10 ** k
They are defined as follows:
f, s = f**2 % 10**k, (1 - (s-1)**2) % 10 ** k
(a) (b)They are also linked together with a simpler formula:
10 ** k = f + s - 1
(2)So you need to calculate only the simpler attractor with (a) and compute the other with (2) before adding them to the solution set
This bit here,
GREEN |= {f, p-f+1}
Would you mind helping me wrap my brain around it?