OFFSET
1,4
COMMENTS
Based on a question from Leroy Quet.
EXAMPLE
a(4)=3 because [2;1,3,4] = 47/17, [2;3,1,4] = 43/19, [4;3,1,2] = 47/11.
MATHEMATICA
Table[Length@Select[Permutations@Range@n, And@@PrimeQ[{Denominator@#, Numerator@#}&@FromContinuedFraction@#]&], {n, 9}] (* Giorgos Kalogeropoulos, Sep 22 2021 *)
PROG
(Python)
from itertools import permutations
from sympy import isprime
from sympy.ntheory.continued_fraction import continued_fraction_reduce
def A078431(n): return sum(1 for p in permutations(range(1, n+1)) if (lambda x: isprime(x.p) and isprime(x.q))(continued_fraction_reduce(p))) # Chai Wah Wu, Sep 22 2021
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Reiner Martin, Dec 30 2002
EXTENSIONS
a(11)-a(13) from Robert Gerbicz, Nov 27 2010
STATUS
approved