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!)
A078433 Number of permutations p of 1,2,...,n such that the numerator of the continued fraction [p(1); p(2),...,p(n)] is prime. 3

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

%S 0,2,2,10,30,124,992,5700,39844,366172,3587856,38861778,435816838

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

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

%o (PARI) a(n)=sum(i=1,n!,isprime(contfracpnqn(numtoperm(n,i))[1,1]))

%o (Python)

%o from itertools import permutations

%o from sympy import isprime

%o from sympy.ntheory.continued_fraction import continued_fraction_reduce

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

%Y Cf. A078431, A078432.

%K nonn,more

%O 1,2

%A _Reiner Martin_, Dec 30 2002

%E a(10)-a(11) from _Robert Gerbicz_, Nov 21 2010

%E a(12)-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 25 05:18 EDT 2024. Contains 371964 sequences. (Running on oeis4.)