수학이 아닌 설명
이것은 배경에 관계없이 접근 할 수있는 설명입니다. 불행히도 수학이 필요하지만 중학교 수준의 이해력을 가진 대부분의 사람들이 이해할 수 있어야합니다.
포인터 시퀀스는 a (n + 1) = a (na (n)) 과 같은 시퀀스입니다 .
이 공식의 의미를 이해하기 위해이 공식을 약간 선택해 봅시다. 이것은 우리가 마지막 용어를 보면서 순서대로 다음 용어를 알아 내고, 많은 단계를 뒤로하고 찾은 용어를 복사한다는 것을 의미합니다. 예를 들어 지금까지 시퀀스가 있었다면
... 3 4 4 4 3 ?
우리는 3 단계 뒤로 물러서 3
... 3 4 4 4 3 ?
^
우리의 결과를 만들기 4
.
일반적으로 우리는 양방향으로 무한한 테이프에서이 게임을하지만, 특정 단계 수만큼 시퀀스의 시작 부분으로 돌아가는 휠에서도 게임을 할 수 있습니다.
예를 들어 시퀀스의 시각화는 다음과 같습니다. [1,3,1,3,1,3]
이제 바퀴 주위의 모든 완전한 회로가 아무것도하지 않는 것과 같기 때문에 바퀴의 셀 수를 초과하는 바퀴의 x , n 은 x mod n 일 수 있습니다. 따라서 모든 멤버가있는 바퀴 만 바퀴 크기보다 작습니다.
수학 설명
포인터 시퀀스는 a (n + 1) = a (na (n)) 과 같은 시퀀스입니다 . 일반적으로 이들은 정수에서 정수로 정의되지만이 정의에 필요한 유일한 것은 후속 함수와 역함수라는 것을 알 수 있습니다. 모든 사이 클릭 그룹에는이 둘이 모두 있으므로 실제로 모든 사이 클릭 그룹의 포인터 시퀀스를 고려할 수 있습니다.
이러한 유형의 기능을 찾기 시작하면 각 기능마다 유사한 기능이 몇 가지 있음을 알 수 있습니다. 예를 들어 Z 3 에서 다음 3은 우리의 요구 사항에 맞는 모든 기능입니다.
f1 : [1,2,2]
f2 : [2,1,2]
f3 : [2,2,1]
(여기서 목록은 결과를 입력으로 색인화하는 함수를 나타내는 데 사용됩니다)
우리는이 기능들이 모두 서로 "회전"하는 것을 알 수 있습니다. 회전의 의미를 공식화하기 위해 함수 b 는 iff 의 회전입니다 .
우리는 여기에 포함 된 수학의 조금 얻을 지금, 만약 우리가 실제로 있다면 것을 보여줄 수있는 A는 포인터 순서는 모든 회전 A는 또한 포인터 순서입니다. 따라서 실제로 서로 회전하는 시퀀스는 동등한 것으로 간주합니다.
태스크
입력 출력으로 n 을 지정 하면 크기가 n 인 포인터 시퀀스의 수입니다 .
이것은 코드 골프 이므로 바이트 수가 적을수록 답이 바이트로 표시됩니다.
테스트 케이스
현재이 테스트 케이스에는 약간의 결함이 있습니다.이를 생성하는 컴퓨터 프로그램이 있지만 그렇게하는 데 속도가 너무 느립니다. 누구든지 더 큰 테스트 케이스를 제공하고 싶다면 (올바로 확인할 수 있음) 자유롭게 할 수 있습니다. 아래의 테스트는 내가 찾은 모든 기능의 목록입니다. 이것은 디버깅에 유용 할 수 있습니다. 문자 제한으로 인해 더 큰 문자를 추가 할 수 없습니다.
내가 여기에 이것을 생성하는 데 사용한 코드를 원한다면
1 -> 1
[[0]]
2 -> 2
[[1,1],[0,0]]
3 -> 4
[[2,2,2],[2,2,1],[1,1,1],[0,0,0]]
4 -> 7
[[3,3,3,3],[3,3,3,2],[2,2,2,2],[3,3,3,1],[3,1,3,1],[1,1,1,1],[0,0,0,0]]
5 -> 12
[[4,4,4,4,4],[4,4,4,4,3],[3,3,3,3,3],[4,4,4,4,2],[4,3,4,4,2],[2,2,2,2,2],[4,4,4,4,1],[4,3,4,4,1],[4,4,2,4,1],[4,4,1,4,1],[1,1,1,1,1],[0,0,0,0,0]]
6 -> 35
[[5,5,5,5,5,5],[5,5,5,5,5,4],[5,5,4,5,5,4],[4,4,4,4,4,4],[5,5,5,5,5,3],[5,4,5,5,5,3],[5,5,5,3,5,3],[5,3,5,3,5,3],[3,3,3,3,3,3],[5,5,5,5,5,2],[5,4,5,5,5,2],[5,3,5,5,5,2],[5,5,4,5,5,2],[5,5,2,5,5,2],[5,5,2,5,2,2],[5,3,2,5,2,2],[5,2,2,5,2,2],[4,2,2,4,2,2],[2,2,2,2,2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