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!)
A157671 Numbers whose ternary representation begins with 2. 8

%I #25 Jan 28 2022 12:16:31

%S 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 65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,162,163,164,165,166,

%U 167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184

%N Numbers whose ternary representation begins with 2.

%C From _R. J. Mathar_, Mar 03 2009: (Start)

%C If we look at the sequence first differences, i.e.,

%C 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 The lower and upper asymptotic densities of this sequence are 1/4 and 1/2, respectively. - _Amiram Eldar_, Feb 28 2021

%H Reinhard Zumkeller, <a href="/A157671/b157671.txt">Table of n, a(n) for n = 1..10000</a>

%F A number k is a term if and only if 2*3^m <= k <= 3^(m+1)-1, for m=0,1,2,...

%F A171960(a(n)) < a(n). - _Reinhard Zumkeller_, Jan 20 2010

%p 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 Flatten[(Range[2*3^#,3^(#+1)-1])&/@Range[0,4]]

%t Select[Range[200],First[IntegerDigits[#,3]]==2&] (* _Harvey P. Dale_, Oct 16 2012 *)

%t Table[FromDigits[#,3]&/@(Join[{2},#]&/@Tuples[{0,1,2},n]),{n,0,4}]// Flatten (* _Harvey P. Dale_, Jan 28 2022 *)

%o (PARI) s=[];for(n=0,4,for(x=3^n,2*3^n-1,s=concat(s,x)));s

%o (Haskell)

%o a157671 n = a157671_list !! (n-1)

%o a157671_list = filter ((== 2) . until (< 3) (flip div 3)) [1..]

%o -- _Reinhard Zumkeller_, Feb 06 2015

%Y Cf. A034472, A132141, A171960.

%Y Subsequence of A134026. - _Reinhard Zumkeller_, Jan 20 2010

%K base,nonn

%O 1,1

%A _Zak Seidov_, Mar 04 2009

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 April 19 05:19 EDT 2024. Contains 371782 sequences. (Running on oeis4.)