If A005117(m) and A000961(m) are the same, a(n) is the mth term.
For m = 1, A005117(m) and A000961(m) are both 1. a(1) = 1.
For m = 2, A005117(m) and A000961(m) are both 2. a(2) = 2.
For m = 3, A005117(m) and A000961(m) are both 3. a(3) = 3.
For m = 6, A005117(m) and A000961(m) are both 7. a(4) = 7.
For m = 12, A005117(m) and A000961(m) are both 17. a(5) = 17.
For m = 13, A005117(m) and A000961(m) are both 19. a(6) = 19.
