|
|
A157671
|
|
Numbers whose ternary representation begins with 2.
|
|
8
|
|
|
2, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24, 25, 26, 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, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
If we look at the sequence first differences, i.e.,
2, 4, 1, 1, 10, 1, 1, 1, 1, 1, 1, 1, 1, 28, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 82, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, we obtain the records in A034472. (End)
The lower and upper asymptotic densities of this sequence are 1/4 and 1/2, respectively. - Amiram Eldar, Feb 28 2021
|
|
LINKS
|
|
|
FORMULA
|
A number k is a term if and only if 2*3^m <= k <= 3^(m+1)-1, for m=0,1,2,...
|
|
MAPLE
|
for n from 1 to 300 do dgs := convert(n, base, 3) ; if op(-1, dgs) = 2 then printf("%d, ", n) ; fi; od: # R. J. Mathar, Mar 03 2009
|
|
MATHEMATICA
|
Flatten[(Range[2*3^#, 3^(#+1)-1])&/@Range[0, 4]]
Select[Range[200], First[IntegerDigits[#, 3]]==2&] (* Harvey P. Dale, Oct 16 2012 *)
Table[FromDigits[#, 3]&/@(Join[{2}, #]&/@Tuples[{0, 1, 2}, n]), {n, 0, 4}]// Flatten (* Harvey P. Dale, Jan 28 2022 *)
|
|
PROG
|
(PARI) s=[]; for(n=0, 4, for(x=3^n, 2*3^n-1, s=concat(s, x))); s
(Haskell)
a157671 n = a157671_list !! (n-1)
a157671_list = filter ((== 2) . until (< 3) (flip div 3)) [1..]
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|