Talk:EKG sequence convergence

From Rosetta Code
Revision as of 17:42, 8 August 2018 by Nigel Galloway (talk | contribs)

N

The task description states "Variants of the sequence can be generated starting 1, N where N is any natural number larger than one". The examples all have N prime. Is it the intention that N may be composite? If so should there be an example say 10? --Nigel Galloway (talk) 14:31, 8 August 2018 (UTC)

Hi Nigel, that second number, then one after the initial 1; can be any integer greater than one. 2 is the base, or normal sequence known as the EKG sequence when people don't mention the variants. When developing the task I noted that 3 and 7 seemed to converge then diverge before finally converging (see the second Python example), so that lead to me asking for 2, 5, and 7.
It can be other than prime. --Paddy3118 (talk) 15:27, 8 August 2018 (UTC)
I'll take that as a yes. I have modified the task to require EKG(9) and EKG(10). If ekg(0)=1 and ekg(1)=N then if N is prime ekg(2)=2N. If N is composite ekg(2)=smallest prime factor of N. As none of the code on the task page attempts to factorize N, I think all the solutions will be wrong. This divergence/convergence is illusionary. OK the video draws a nice chart and compares it to the tree of life, but this just goes to prove that people should need a license to use PowerPoint, and similar. It says nothing about the relationship of N1 and N2. More interesting would be to find how out of kilter ekg(N) is with ekg(2). That is how many transpositions are needed to convert ekg(2) to ekg(N). I think this would partition the natural numbers into a small number of sets. --Nigel Galloway (talk) 17:41, 8 August 2018 (UTC)