login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A078432 Number of permutations p of 1,2,...,n such that the denominator of the continued fraction [p(1); p(2),...,p(n)] is prime. 3

%I #14 Oct 30 2022 18:19:59

%S 0,1,4,14,32,204,994,7526,48636,421392,4018976,41304726,490878388

%N Number of permutations p of 1,2,...,n such that the denominator of the continued fraction [p(1); p(2),...,p(n)] is prime.

%t Table[Length@Select[Permutations@Range@n,PrimeQ@Denominator@FromContinuedFraction@#&],{n,9}] (* _Giorgos Kalogeropoulos_, Sep 22 2021 *)

%o (Python)

%o from itertools import permutations

%o from sympy import isprime

%o from sympy.ntheory.continued_fraction import continued_fraction_reduce

%o def A078432(n): return sum(1 for p in permutations(range(1,n+1)) if isprime(continued_fraction_reduce(p).q)) # _Chai Wah Wu_, Sep 22 2021

%Y Cf. A078431, A078433.

%K nonn,more

%O 1,3

%A _Reiner Martin_, Dec 30 2002

%E a(10)-a(13) from _Robert Gerbicz_, Nov 27 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)