[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
login
Search: a170951 -id:a170951
     Sort: relevance | references | number | modified | created      Format: long | short | data
Numbers n with the property that 1/n can be written in base 3 in such a way that the fractional part contains no 1's.
+10
12
1, 3, 4, 9, 10, 12, 13, 27, 28, 30, 36, 39, 40, 81, 82, 84, 90, 91, 108, 117, 120, 121, 243, 244, 246, 252, 270, 273, 324, 328, 351, 360, 363, 364, 729, 730, 732, 738, 756, 757, 810, 819, 820, 949, 972, 984, 1036, 1053, 1080, 1089, 1092, 1093, 2187
OFFSET
1,2
COMMENTS
Numbers n such that 1/n is in the Cantor set.
A subsequence of A054591. The first member of A054591 which does not belong to this sequence is 146. See A135666.
This is not a subsequence of A005836 (949 belongs to the present sequence but not to A005836). See A170830, A170853.
LINKS
T. D. Noe and N. J. A. Sloane, Table of n, a(n) for n=1..1164 (terms < 3^21)
D. Jordan and R. Schayer Rational points on the Cantor middle thirds set [Broken link corrected by Rainer Rosenthal, Feb 20 2009]
EXAMPLE
1/3 in base 3 can be written as either .1 or .0222222... The latter version contains no 1's, so 3 is in the sequence.
1/4 in base 3 is .02020202020..., so 4 is in the sequence.
MATHEMATICA
(Mma code from T. D. Noe, Feb 20 2010. This produces the sequence except for the powers of 3.)
# Find the length of the periodic part of the fraction:
FracLen[n_] := Module[{r = n/3^IntegerExponent[n, 3]}, MultiplicativeOrder[3, r]]
# Generate the fractions and select those that have no 1's:
Select[Range[100000], ! MemberQ[Union[RealDigits[1/#, 3, FracLen[ # ]][[1]]], 1] &]
PROG
(PARI) is(n, R=divrem(3^logint(n, 3), n), S=0)={while(R[1]!=1&&!bittest(S, R[2]), S+=1<<R[2]; R=divrem(R[2]*3, n)); R[1]!=1||R[2]==0} \\ M. F. Hasler, Feb 27 2018
KEYWORD
nonn,base
AUTHOR
Jack W Grahl, Aug 12 2006
EXTENSIONS
Extended to 10^5 by T. D. Noe and N. J. A. Sloane, Feb 20 2010
Entry revised by N. J. A. Sloane, Feb 22 2010
STATUS
approved
Numbers n with the property that when 1/n is written in base 3 (in either of the two representations, if the representation is ambiguous) the fractional part contains no 1's.
+10
5
1, 4, 10, 12, 13, 28, 30, 36, 39, 40, 82, 84, 90, 91, 108, 117, 120, 121, 244, 246, 252, 270, 273, 324, 328, 351, 360, 363, 364, 730, 732, 738, 756, 757, 810, 819, 820, 949, 972, 984, 1036, 1053, 1080, 1089, 1092, 1093, 2188, 2190, 2196, 2214, 2268, 2271, 2362, 2430
OFFSET
1,2
COMMENTS
That is, neither of the two representations of 1/n in base 3 contain a 1.
This is A121153 without the numbers 3^k, k >= 1. See that entry for further information.
LINKS
T. D. Noe and N. J. A. Sloane, Table of n, a(n) for n=1..1144 (terms < 3^21)
EXAMPLE
1/3 in base 3 can be written as either .1 or .0222222... The first version contains a 1, so 3 is not in the sequence.
1/4 in base 3 is .02020202020..., so 4 is in the sequence.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. H. Conway, T. D. Noe and N. J. A. Sloane, Feb 20 2010
STATUS
approved
Complement of A121153.
+10
3
2, 5, 6, 7, 8, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 31, 32, 33, 34, 35, 37, 38, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 83, 85, 86, 87, 88, 89
OFFSET
1,1
COMMENTS
If n is a term in this sequence then i/n is not in the Cantor set.
CROSSREFS
KEYWORD
nonn
AUTHOR
J. H. Conway and N. J. A. Sloane, Feb 20 2010
STATUS
approved
Take the Cantor set sequence A121153 and if the entry m = A121153(n) is in the range 3^k <= m < 3^(k+1), subtract 3^k from it.
+10
3
0, 0, 1, 0, 1, 3, 4, 0, 1, 3, 9, 12, 13, 0, 1, 3, 9, 10, 27, 36, 39, 40, 0, 1, 3, 9, 27, 30, 81, 85, 108, 117, 120, 121, 0, 1, 3, 9, 27, 28, 81, 90, 91, 220, 243, 255, 307, 324, 351, 360, 363, 364, 0, 1, 3, 9, 27, 81, 84, 175, 243, 270, 273, 625, 660, 729, 733, 765, 921, 972, 1053
OFFSET
1,6
LINKS
EXAMPLE
If written as a triangle:
0,
0, 1,
0, 1, 3, 4,
0, 1, 3, 9, 12, 13,
0, 1, 3, 9, 10, 27, 36, 39, 40,
0, 1, 3, 9, 27, 30, 81, 85, 108, 117, 120, 121,
0, 1, 3, 9, 27, 28, 81, 90, 91, 220, 243, 255, 307, 324, 351, 360, 363, 364,
0, 1, 3, 9, 27, 81, 84, 175, 243, 270, 273, 625, 660, 729, 733, 765, 921, 972, 1053, 1080, 1089, 1092, 1093,
...
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
J. H. Conway, T. D. Noe and N. J. A. Sloane, Feb 22 2010
STATUS
approved
Number of fractions i/n that are in the Cantor set.
+10
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
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
KEYWORD
nonn,easy
AUTHOR
Jason Yuen, Dec 30 2023
STATUS
approved

Search completed in 0.007 seconds