OFFSET
1,2
COMMENTS
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
CROSSREFS
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