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!)
A228805 Number of distinct denominators of rational numbers whose continued fraction consists exclusively of 1s and 2s and has length <=n. 2

%I #9 Nov 20 2023 08:19:24

%S 1,2,4,8,14,26,45,85,155,286,540,1047,2014,3939,7642,15082,29601,

%T 58797,116248,231530,459976,917030,1826669,3641525,7253511,14463688,

%U 28834305,57481793,114543879,228286471

%N Number of distinct denominators of rational numbers whose continued fraction consists exclusively of 1s and 2s and has length <=n.

%e a = 1 counts the denominators in {1/1,2/1} corresponding to the continued fractions [1] and [2]; a(2) = 2 counts the denominators in {1/1,2/1,2/1,3/2,3/1,5/2} corresponding to the continued fractions [1], [2], [1,1], [1,2], [2,1], [2,2].

%t a[n_] := Length[Sort[Union[Denominator[Map[FromContinuedFraction, Flatten[Map[Tuples[{1, 2}, #] &, Range[n]], 1]]]]]]; Table[a[n], {n, 1, 12}]

%o (Sage)

%o import itertools

%o def a(n):

%o ans = set()

%o for k in range(1, n+1):

%o for p in itertools.product([1,2], repeat=k):

%o ans.add(continued_fraction(p).value().denominator())

%o return len(ans) # _Robin Visser_, Nov 19 2023

%Y Cf. A228803.

%K nonn,easy

%O 1,2

%A _Clark Kimberling_, Sep 04 2013

%E a(23)-a(30) from _Robin Visser_, Nov 19 2023

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 September 11 16:20 EDT 2024. Contains 375836 sequences. (Running on oeis4.)