18
1
It is well known that odd primes will appear in Pascal's triangle exactly twice. However, not all numbers that appear exactly twice in Pascal's triangle are prime. We'll call these numbers Pascal primes.
Pascal primes are composite numbers that appear exactly twice in Pascal's triangle. The first few Pascal primes are
4, 8, 9, 12, 14, 16, 18, ...
Your challenge is to take a positive integer n as input and output true or false, depending on if n is a Pascal prime or not. This is code-golf, so the shortest program wins!
Relevant OEIS. – Martin Ender – 2018-01-01T13:27:00.653
2Can we output True if it isn't a Pascal prime and false if it is? – caird coinheringaahing – 2018-01-01T13:44:37.653
This sequence is OEIS sequence A002808's intersection with OEIS sequence A137905.
– totallyhuman – 2018-01-01T19:27:49.643@cairdcoinheringaahing no, it must be in the given requirement. – Simply Beautiful Art – 2018-01-01T19:43:48.047
I'm surprised nobody has posted an answer in Pascal. I will if I get the time (and if I can find my old Pascal compiler). – manassehkatz-Moving 2 Codidact – 2018-01-02T15:40:51.293