cp's OEIS Frontend

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.

A006899 Numbers of the form 2^i or 3^j.

This page as a plain text file.
%I A006899 M0588 #91 May 03 2025 22:24:42
%S A006899 1,2,3,4,8,9,16,27,32,64,81,128,243,256,512,729,1024,2048,2187,4096,
%T A006899 6561,8192,16384,19683,32768,59049,65536,131072,177147,262144,524288,
%U A006899 531441,1048576,1594323,2097152,4194304,4782969,8388608,14348907,16777216,33554432
%N A006899 Numbers of the form 2^i or 3^j.
%C A006899 Complement of A033845 with respect to A003586. - _Reinhard Zumkeller_, Sep 25 2008
%C A006899 In the 14th century, Levi Ben Gerson proved that the only pairs of terms which differ by 1 are (1, 2), (2, 3), (3, 4), and (8, 9); see A235365, A235366, A236210. - _Jonathan Sondow_, Jan 20 2014
%C A006899 Numbers n such that absolute value of the greatest prime factor of n minus the smallest prime not dividing n is 1 (that is, abs(A006530(n)-A053669(n)) = 1). - _Anthony Browne_, Jun 26 2016
%C A006899 Deficient 3-smooth numbers, i.e., intersection of A005100 and A003586. - _Amiram Eldar_, Jun 03 2022
%D A006899 G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 78.
%D A006899 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A006899 T. D. Noe, <a href="/A006899/b006899.txt">Table of n, a(n) for n = 1..500</a>
%H A006899 Boris Alexeev, <a href="https://arxiv.org/abs/cs/0309052">Minimal DFAs for testing divisibility</a>, arXiv:cs/0309052 [cs.CC], 2003.
%H A006899 Jung-Chao Ban, Wen-Guei Hu, and Song-Sun Lin, <a href="http://arxiv.org/abs/1207.7154">Pattern generation problems arising in multiplicative integer systems</a>, arXiv preprint arXiv:1207.7154 [math.DS], 2012.
%H A006899 Lukas Spiegelhofer, <a href="https://arxiv.org/abs/2105.11173">Collisions of the binary and ternary sum-of-digits functions</a>, arXiv:2105.11173 [math.NT], 2021.
%H A006899 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PillaisTheorem.html">Pillai's Theorem</a>.
%F A006899 a(n) = A085239(n)^A085238(n). - _Reinhard Zumkeller_, Jun 22 2003
%F A006899 A086411(a(n)) = A086410(a(n)). - _Reinhard Zumkeller_, Sep 25 2008
%F A006899 A053669(a(n)) - A006530(a(n)) = (-1)^a(n) n > 1. - _Anthony Browne_, Jun 26 2016
%F A006899 Sum_{n>=1} 1/a(n) = 5/2. - _Amiram Eldar_, Jun 03 2022
%F A006899 a(n)^(1/n) tends to 3^(log(2)/log(6)) = 2^(log(3)/log(6)) = 1.529592328491883538... - _Vaclav Kotesovec_, Sep 19 2024
%p A006899 A:={seq(2^n,n=0..63)}: B:={seq(3^n,n=0..40)}: C:=sort(convert(A union B,list)): seq(C[j],j=1..39); # _Emeric Deutsch_, Aug 03 2005
%t A006899 seqMax = 10^20; Union[2^Range[0, Floor[Log[2, seqMax]]], 3^Range[0, Floor[Log[3, seqMax]]]] (* _Stefan Steinerberger_, Apr 08 2006 *)
%o A006899 (Haskell)
%o A006899 a006899 n = a006899_list !! (n-1)
%o A006899 a006899_list = 1 : m (tail a000079_list) (tail a000244_list) where
%o A006899    m us'@(u:us) vs'@(v:vs) = if u < v then u : m us vs' else v : m us' vs
%o A006899 -- _Reinhard Zumkeller_, Oct 09 2013
%o A006899 (PARI) is(n)=n>>valuation(n,2)==1 || n==3^valuation(n,3) \\ _Charles R Greathouse IV_, Aug 29 2016
%o A006899 (PARI) upto(n) = my(res = vector(logint(n, 2) + logint(n, 3) + 1), t = 1); res[1] = 1; for(i = 2, 3, for(j = 1, logint(n, i), t++; res[t] = i^j)); vecsort(res) \\ _David A. Corneth_, Oct 26 2017
%o A006899 (PARI) a(n) = my(i0= logint(3^(n-1),6), i= logint(3^n,6)); if(i > i0, 2^i, my(j=logint(2^n,6)); 3^j) \\ _Ruud H.G. van Tol_, Nov 10 2022
%o A006899 (Python)
%o A006899 from sympy import integer_log
%o A006899 def A006899(n): return 1<<k if integer_log(m:=3**(n-1),6)[0]<(k:=integer_log(3*m,6)[0]) else 3**integer_log(1<<n,6)[0] # _Chai Wah Wu_, Oct 01 2024
%Y A006899 Union of A000079 and A000244. - _Reinhard Zumkeller_, Sep 25 2008
%Y A006899 Cf. A085238, A085239.
%Y A006899 Cf. A003586, A005100, A006530, A053669.
%Y A006899 Cf. A170803, A235365, A235366, A236210.
%Y A006899 A186927 and A186928 are subsequences.
%Y A006899 Cf. A108906 (first differences), A006895, A227928.
%K A006899 nonn,easy,nice
%O A006899 1,2
%A A006899 _Simon Plouffe_ and _N. J. A. Sloane_
%E A006899 More terms from _Reinhard Zumkeller_, Jun 22 2003