A175764 Number of iterations of the mapping k->f(k) to reach one of 2, 5, or 29, starting with k=n, and with f(k)=(k^2+4)/d, where d is the next-to-largest divisor of k^2+4, or -1 if the sequence never reaches one of the required values.
1, 0, 9, 1, 0, 1, 2, 1, 1, 1, 1, 1, 8, 1, 2, 1, 4, 1, 1, 1, 1, 1, 9, 1, 5, 1, 3, 1, 0, 1, 1, 1, 3, 1, 2, 1, 6, 1, 1, 1, 1, 1, 5, 1, 2, 1, 10, 1, 1, 1, 1, 1, 1, 1, 9, 1, 10, 1, 1, 1, 1, 1, 1, 1, 2, 1, 6, 1, 1, 1, 1, 1, 10, 1, 9, 1, 5, 1, 1, 1, 1, 1, 2, 1, 2, 1, 6, 1, 1, 1, 1, 1, 5, 1, 2, 1, 3, 1, 1, 1, 1, 1, 11
Offset: 1
Keywords
Examples
For n=3, we have 3 -> (3^2+4)/d = 13/1 -> (13^2+4)/d = 173/1 -> (173^2+4)/d = 29933/809 = 37, since the divisors of 29933 are {1,37,809,29933}. Continuing, we get the orbit {3,13,173,37,1373,1217,97,9413,89,5,29,5,29,...}, showing that 5 is reached after 9 steps, after which the orbit is periodic {...,5,29,5,29,...}. Thus a(3)=9.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..47016
Programs
-
PARI
A175764(n) = if(2==n||5==n||29==n,0,1+A175764(f(n))); f(k) = { my(u=(4+(k^2)), ds=divisors(u)); (u/ds[#ds-1]); }; \\ Alternatively, "f" could be defined as: f(k) = { my(u=(4+(k^2))); (u/A032742(u)); }; A032742(n) = if(1==n||isprime(n),1,forprime(p=2,n,if(!(n%p),return(n/p)))); \\ And not requiring full factorization when this is used. - Antti Karttunen, May 19 2021
Comments