[math-fun] Add or subtract the nearest square
Hi all, I've been playing around with an idea and thought I would share it. Begin with a non-negative integer n. Then iterate: - Find the nearest square to n. This will either be (floor(sqrt(n)))^2 or (floor(sqrt(n))+1)^2. - If the square is more than n, then the new n = n + square. Otherwise, n = n - square. - If n > 0, continue iterating, otherwise, stop. As an example, the trajectory of 15 is: 1. 31 (add the nearest square 16) 2. 67 (add the nearest square 36) 3. 3 (subtract 64) 4. 7 (add 4) 5. 16 (add 9) 6. 0 (subtract 16). How many iterations are required to get to 0, for a given starting value? The number of iterations rises slowly and erratically, with n = 820 needing 16 and n = 9709 needing 20 (both highwater marks). Of course, if n is a perfect square, then it only takes one iteration to get to 0. Do all initial values of n lead to 0? I think so, but I can't prove it. The largest number of iterations I've seen is 47 for n = 38,034,564,952 (I've checked up to 100,000,000,000, using Pari). If this is interesting, I can submit sequences for a(n) = the number of iterations for trajectories starting with n and for a(n) = the smallest initial value to require n iterations. Kerry
Kerry, Sure, go ahead and submit them! You could also mention the maps x -> A053187(x) (nearest square) and x -> A053188(x) (distance away) On Tue, Nov 3, 2020 at 2:42 AM Kerry Mitchell <lkmitch@gmail.com> wrote:
Hi all,
I've been playing around with an idea and thought I would share it.
Begin with a non-negative integer n. Then iterate:
- Find the nearest square to n. This will either be (floor(sqrt(n)))^2 or (floor(sqrt(n))+1)^2. - If the square is more than n, then the new n = n + square. Otherwise, n = n - square. - If n > 0, continue iterating, otherwise, stop.
As an example, the trajectory of 15 is:
1. 31 (add the nearest square 16) 2. 67 (add the nearest square 36) 3. 3 (subtract 64) 4. 7 (add 4) 5. 16 (add 9) 6. 0 (subtract 16).
How many iterations are required to get to 0, for a given starting value? The number of iterations rises slowly and erratically, with n = 820 needing 16 and n = 9709 needing 20 (both highwater marks). Of course, if n is a perfect square, then it only takes one iteration to get to 0.
Do all initial values of n lead to 0? I think so, but I can't prove it. The largest number of iterations I've seen is 47 for n = 38,034,564,952 (I've checked up to 100,000,000,000, using Pari).
If this is interesting, I can submit sequences for a(n) = the number of iterations for trajectories starting with n and for a(n) = the smallest initial value to require n iterations.
Kerry _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
participants (2)
-
Kerry Mitchell -
Neil Sloane