Brachylog, 17 bytes
{>I-2:I{ṗ/1}m}fc+
This is the brand new version of Brachylog, with a shiny code page!
###Explanation
Explanation
{ }f Find all valid outputs of the predicate in brackets
c+ Output is the sum of that list after flattening it
>I Input > I
-2:I The list [I-2, I]
{ }m Map:
ṗ/1 Must be prime and the output is its inverse
Brachylog, 17 bytes
{>I-2:I{ṗ/1}m}fc+
This is the brand new version of Brachylog, with a shiny code page!
###Explanation
{ }f Find all valid outputs of the predicate in brackets
c+ Output is the sum of that list after flattening it
>I Input > I
-2:I The list [I-2, I]
{ }m Map:
ṗ/1 Must be prime and the output is its inverse
Brachylog, 17 bytes
{>I-2:I{ṗ/1}m}fc+
This is the brand new version of Brachylog, with a shiny code page!
Explanation
{ }f Find all valid outputs of the predicate in brackets
c+ Output is the sum of that list after flattening it
>I Input > I
-2:I The list [I-2, I]
{ }m Map:
ṗ/1 Must be prime and the output is its inverse
Brachylog, 17 bytes
{>I-2:I{ṗ/1}m}fc+
This is the brand new version of Brachylog, with a shiny code page!
###Explanation
{ }f Find all valid outputs of the predicate in brackets
c+ Output is the sum of that list after flattening it
>I Input > I
-2:I The list [I-2, I]
{ }m Map:
ṗ/1 Must be prime and the output is its inverse