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.

A022328 Exponent of 2 (value of i) in n-th number of form 2^i*3^j, i >= 0, j >= 0 (see A003586).

This page as a plain text file.
%I A022328 #51 Sep 16 2024 12:39:44
%S A022328 0,1,0,2,1,3,0,2,4,1,3,0,5,2,4,1,6,3,0,5,2,7,4,1,6,3,0,8,5,2,7,4,1,9,
%T A022328 6,3,0,8,5,2,10,7,4,1,9,6,3,11,0,8,5,2,10,7,4,12,1,9,6,3,11,0,8,5,13,
%U A022328 2,10,7,4,12,1,9,6,14,3,11,0,8,5,13,2,10,7,15,4,12,1,9,6,14,3,11,0,8,16,5,13,2
%N A022328 Exponent of 2 (value of i) in n-th number of form 2^i*3^j, i >= 0, j >= 0 (see A003586).
%C A022328 From _Clark Kimberling_, Mar 18 2015 and May 21 2015: (Start)
%C A022328 This is the signature sequence of log(3)/log(2) and is a fractal sequence; e.g., if the first occurrence of each n is removed, the resulting sequence is the original sequence.
%C A022328 Moreover, if the sequence is partitioned into segments starting with 0 as follows:
%C A022328   0,1
%C A022328   0,2,1,3
%C A022328   0,2,4,1,3
%C A022328   0,5,2,4,1,6,3,
%C A022328 and so on, then deleting the greatest number in each segment leaves
%C A022328   0
%C A022328   0,2,1
%C A022328   0,2,1,3
%C A022328   0,5,2,4,1,3,
%C A022328 and so on, which, concatenated to (0,0,2,1,0,2,1,3,0,5,2,4,1,3,...), is another fractal sequence, in today's usual meaning of that term.  When introduced in 1995, one of the defining properties of a fractal sequence was, essentially, that before each n appears, every k < n must have already appeared; this requirement ensures that the sequence yields a dispersion; e.g., A114577 yields A114537.  However, the usual meaning of "fractal sequence" nowadays is simply "a sequence that contains itself as a proper subsequence".  It is proposed here that the original version be renamed "strongly fractal".  Thus, the operations called upper trimming and lower trimming (e.g., A084531, A167237), when applied to strongly fractal sequences, yield strongly fractal sequences.  The operation introduced here, which can be called "segment-upper trimming", carries fractal sequences to fractal sequences, but not strongly fractal to strongly fractal.
%C A022328 Associated with the signature sequence S of each positive irrational number is an interspersion (or equivalently, a dispersion), in which row n >= 0 consists of the positions of n in S. The interspersion associated with the signature sequence of log(3)/log(2) is A255975.
%C A022328 (End)
%C A022328 Comment from _Allan C. Wechsler_, May 26 2024 (Start):
%C A022328 More generally, the "signature sequence" of an irrational number H can be defined as follows. Consider all the numbers of the form a + bH, where a and b are positive integers, and sort them into increasing order (there are no cluster points or other obstacles). The sequence of a-values is then the *signature sequence of H.
%C A022328 If the coefficients a and b are allowed to be 0, you get the same sequence but with all the entries decremented by 1.
%C A022328 (End)
%C A022328 a(n) = A069352(n) - A022329(n). - _Reinhard Zumkeller_, May 16 2015
%H A022328 Reinhard Zumkeller, <a href="/A022328/b022328.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from Franklin T. Adams-Watters)
%H A022328 Clark Kimberling, <a href="http://matwbn.icm.edu.pl/ksiazki/aa/aa73/aa7321.pdf">Numeration systems and fractal sequences</a>, Acta Arithmetica 73 (1995) 103-117.
%F A022328 a(n) = A191475(n) - 1. - _Franklin T. Adams-Watters_, Mar 19 2009 [Corrected by _N. J. A. Sloane_, May 26 2024]
%F A022328 A003586(n) = 2^a(n)*3^A022329(n). - _N. J. A. Sloane_, Mar 19 2009
%t A022328 t = Sort[Flatten[Table[2^i 3^j, {i, 0, 200}, {j, 0, 200}]]];
%t A022328 Table[IntegerExponent[t[[n]], 2], {n, 1, 200}]  (* A022338 *)
%t A022328 (* _Clark Kimberling_, Mar 18 2015 *)
%o A022328 (Haskell)
%o A022328 import Data.Set (singleton, deleteFindMin, insert)
%o A022328 a022328 n = a022328_list !! (n-1)
%o A022328 (a022328_list, a022329_list) = unzip $ f $ singleton (1, (0, 0)) where
%o A022328    f s = (i, j) :
%o A022328          f (insert (2 * y, (i + 1, j)) $ insert (3 * y, (i, j + 1)) s')
%o A022328          where ((y, (i, j)), s') = deleteFindMin s
%o A022328 -- _Reinhard Zumkeller_, Nov 19 2015, May 16 2015
%o A022328 (Python)
%o A022328 from sympy import integer_log
%o A022328 def A022328(n):
%o A022328     def bisection(f,kmin=0,kmax=1):
%o A022328         while f(kmax) > kmax: kmax <<= 1
%o A022328         while kmax-kmin > 1:
%o A022328             kmid = kmax+kmin>>1
%o A022328             if f(kmid) <= kmid:
%o A022328                 kmax = kmid
%o A022328             else:
%o A022328                 kmin = kmid
%o A022328         return kmax
%o A022328     def f(x): return n+x-sum((x//3**i).bit_length() for i in range(integer_log(x,3)[0]+1))
%o A022328     return (~(m:=bisection(f,n,n))&m-1).bit_length() # _Chai Wah Wu_, Sep 15 2024
%Y A022328 Cf. A003586, A033485, A022329, A191475. - _Franklin T. Adams-Watters_, Mar 19 2009
%Y A022328 Cf. A069352.
%K A022328 nonn
%O A022328 1,4
%A A022328 _Clark Kimberling_