Redivosite is a portmanteau word invented for the sole purpose of this challenge. It's a mix of Reduction, Division and Composite.
Given an integer N > 6:
- If N is prime, N is not a Redivosite Number.
- If N is composite:
- repeatedly compute N' = N / d + d + 1 until N' is prime, where d is the smallest divisor of N greater than 1
- N is a Redivosite Number if and only if the final value of N' is a divisor of N
Below are the 100 first Redivosite Numbers (no OEIS entry at the time of posting):
- N = 13: 13 is prime, so 13 is not a Redivosite Number
- N = 32: 32 / 2 + 3 = 19; 19 is not a divisor or 32, so 32 is not a Redivosite Number
- N = 260: 260 / 2 + 3 = 133, 133 / 7 + 8 = 27, 27 / 3 + 4 = 13; 13 is a divisor or 260, so 260 is a Redivosite Number
- Given an integer N, return a truthy value if it's a Redivosite Number or a falsy value otherwise. (You may also output any two distinct values, as long as they're consistent.)
- The input is guaranteed to be larger than 6.
- This is code-golf, so the shortest answer in bytes wins!