This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A157671 #25 Jan 28 2022 12:16:31 %S A157671 2,6,7,8,18,19,20,21,22,23,24,25,26,54,55,56,57,58,59,60,61,62,63,64, %T A157671 65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,162,163,164,165,166, %U A157671 167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184 %N A157671 Numbers whose ternary representation begins with 2. %C A157671 From _R. J. Mathar_, Mar 03 2009: (Start) %C A157671 If we look at the sequence first differences, i.e., %C A157671 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) %C A157671 The lower and upper asymptotic densities of this sequence are 1/4 and 1/2, respectively. - _Amiram Eldar_, Feb 28 2021 %H A157671 Reinhard Zumkeller, <a href="/A157671/b157671.txt">Table of n, a(n) for n = 1..10000</a> %F A157671 A number k is a term if and only if 2*3^m <= k <= 3^(m+1)-1, for m=0,1,2,... %F A157671 A171960(a(n)) < a(n). - _Reinhard Zumkeller_, Jan 20 2010 %p A157671 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 %t A157671 Flatten[(Range[2*3^#,3^(#+1)-1])&/@Range[0,4]] %t A157671 Select[Range[200],First[IntegerDigits[#,3]]==2&] (* _Harvey P. Dale_, Oct 16 2012 *) %t A157671 Table[FromDigits[#,3]&/@(Join[{2},#]&/@Tuples[{0,1,2},n]),{n,0,4}]// Flatten (* _Harvey P. Dale_, Jan 28 2022 *) %o A157671 (PARI) s=[];for(n=0,4,for(x=3^n,2*3^n-1,s=concat(s,x)));s %o A157671 (Haskell) %o A157671 a157671 n = a157671_list !! (n-1) %o A157671 a157671_list = filter ((== 2) . until (< 3) (flip div 3)) [1..] %o A157671 -- _Reinhard Zumkeller_, Feb 06 2015 %Y A157671 Cf. A034472, A132141, A171960. %Y A157671 Subsequence of A134026. - _Reinhard Zumkeller_, Jan 20 2010 %K A157671 base,nonn %O A157671 1,1 %A A157671 _Zak Seidov_, Mar 04 2009