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!)
A368558 Number of fractions i/n that are in the Cantor set. 1
2, 2, 4, 4, 2, 4, 2, 4, 8, 6, 2, 8, 8, 2, 4, 4, 2, 8, 2, 8, 4, 2, 2, 8, 2, 8, 16, 10, 2, 12, 2, 4, 4, 2, 2, 16, 2, 2, 16, 16, 2, 4, 2, 4, 8, 2, 2, 8, 2, 6, 4, 10, 2, 16, 2, 10, 4, 2, 2, 16, 2, 2, 8, 4, 8, 4, 2, 4, 4, 6, 2, 16, 2, 2, 4, 4, 2, 16, 2, 16 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
The Cantor set is all reals in the range [0,1] which can be written in ternary without using digit 1 (including allowing 0222... to be used instead of 1000...).
All terms are even.
a(n) = O(n^(log_3(2))).
a(n) is the number of solutions to CCC 2023, Problem S5.
Does this sequence contain every positive even integer?
LINKS
2023 Canadian Computing Competition Senior Committee, CCC 2023, Problem S5: The Filter, University of Waterloo. See pages 17-18.
2023 Canadian Computing Competition Senior Committee, 2023 CCC Senior Problem Commentary, University of Waterloo. See pages 5-6.
Zixiang Zhou, main.cpp. This C++ program solves CCC 2023, Problem S5 with a time complexity of O(n^(log_3(2)) log n).
EXAMPLE
For n = 12, there are a(12) = 8 fractions, and their numerators are i = 0, 1, 3, 4, 8, 9, 11, 12.
PROG
(Python)
def is_member(i, n): # Returns True if i/n is in the Cantor set
visited = set()
while True:
if n < 3 * i < 2 * n: return False
if i in visited: return True
visited.add(i)
i = 3 * min(i, n - i)
def a(n): return sum(is_member(i, n) for i in range(n + 1))
CROSSREFS
Sequence in context: A130501 A049116 A065176 * A060267 A214516 A352502
KEYWORD
nonn,easy
AUTHOR
Jason Yuen, Dec 30 2023
STATUS
approved

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 July 11 07:19 EDT 2024. Contains 374216 sequences. (Running on oeis4.)