# Find prime factors of sum of non-composite Fibonacci numbers up to n

The Challenge

Given a number, find the sum of the non-composite numbers in the Fibonacci sequence up to that number, and find the prime factors of the sum.

For example, if you were given 8, the non-composite numbers would be 1, 1, 2, 3, and 5. Adding these up would get 12. The prime factors of 12 are 2, 2 and 3, so your program should return something along the lines of 2, 2, 3 when given 12.

The Objective

This is Code Golf, so the answer with the least amount of bytes wins.

• The title reads like something out of a PPCG Markov chain generator. Primes and Fibonacci numbers have been way overdone (see this about primes). This isn't something I'd expect a new user to necessarily know, so a heads up for potential downvotes. – xnor Feb 20 '18 at 7:04

# Neim, 8 bytes

𝐈f𝕌Σ𝐭}𝐬𝐏


Doesn't work on TIO, but works locally.

Explanation:

𝐈            Inclusive range [1 .. input]
f           Fibonacci numbers
𝕌         Get elements that are only in both lists
Σ         Keep each element where running the following is falsy
𝐭          Check if composite
}       Close loop
𝐬       Sum
𝐏     Prime factors