유명한 피보나치 수열은 F(0) = 0; F(1) = 1; F(N+1) = F(N) + F(N-1)(이 도전을 위해 우리는 0으로 시작합니다)입니다.
챌린지 : n이 주어지면 , n 번째 피보나치 수 의 모든 제수 d 에 대한 모든 d 번째 피보나치 수 의 합을 출력하십시오 . 좀 더 공식적인 표기법을 선호한다면
입력 : 양의 정수 n
출력 : 합계
예를 들어을 고려하십시오 n=4. F(4) = 33의 제수는 1과 3이므로 출력은이어야합니다 F(1) + F(3) = 1 + 2 = 3.
내용 n=6, F(6) = 8및 (8)의 약수가 출력되는 1, 2, 4, 8, 그래서있다 F(1) + F(2) + F(4) + F(8) = 1 + 1 + 3 + 21 = 26.
테스트 사례 :
1 => 1
2 => 1
3 => 2
4 => 3
5 => 6
6 => 26
답변
실제로 5 바이트
F÷♂FΣ
작동 원리
       (implicit) Read n from STDIN.
F      Compute F(n).
 ÷     Get F(n)'s divisors.
  ♂F   Map F over the divisors.
    Σ  Take the sum.
답변
젤리 , 7 바이트
ÆḞÆDÆḞS
설명:
ÆḞÆDÆḞS Main link (Arguments: z)
ÆḞ      zth Fibonacci number's
  ÆD                           divisors'
    ÆḞ                                   Fibonacci numbers'
      S                                                     sum
답변
매스 매 티카, 29 바이트
f=Fibonacci;f@#~DivisorSum~f&
답변
답변
답변
05AB1E , 11 바이트
!ÅFDI<èÑ<èO
설명
!            # factorial of input
 ÅF          # get the list of fibonacci numbers (starting at 1)
             # smaller than or equal to this
   D         # duplicate list of fibonacci number
    I<è      # get the element at index (input-1)
       Ñ     # get the list of its divisors
        <    # decrement each
         è   # get the fibonacci numbers at those indices
          O  # sum