# Number of prime knots with n crossings

A prime knot is:

a non-trivial knot which cannot be written as the knot sum of two non-trivial knots.

Explanation of a knot-sum: put the two knots adjacent,

... then draw two lines between them, to the same strand on each side, and remove the part between the lines you just drew. This composition of two knots will form a new, non-prime knot.

Here are all prime knots with 7 or fewer crossings (the Unknot is not prime):

You need to output the number of unique prime knots for a given number of crossings.

1   0
2   0
3   1
4   1
5   2
6   3
7   7
8   21
9   49
10  165
11  552
12  2176
13  9988
14  46972
15  253293
16  1388705


I don't think the values are known for inputs larger than 16, but if given such an input, your code would need to find the correct result given enough time.

OEIS - A002863

• Perhaps someone will find this Mathematica library useful. Commented Dec 19, 2016 at 20:44

# Mathematica + KnotTheory, 13 bytes

NumberOfKnots
`

I didn't know this built-in function existed when I commented that the package might be useful. Everyone else had an equal chance to find it, since I commented about the library. I found it in the list of Lightly Documented Features. Still, I won't accept this answer, since I want to see answers by other people.

• Seeing as the documentation is very poor are you sure this works for numbers greater than 16? Commented Dec 22, 2016 at 16:03
• @WheatWizard No, I'm not sure how to tell. It would take way too long to run to completion. Is there a way to find out how it's implemented? Commented Dec 22, 2016 at 16:40
• Have you tried running it? It might just return an error. I can't run mathematica right now but I would check if it stalls when you attempt to run it. Commented Dec 22, 2016 at 17:07
• @WheatWizard I can't check either. Let me know if you try it. Commented Dec 22, 2016 at 17:49
• I actually looked through the source code for a bit, searching for it, but I didn't find the definition. The repository is publicly available. katlas.math.toronto.edu/svn/KnotTheory/trunk/KnotTheory Commented Dec 22, 2016 at 17:56