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.

A064515 Write A064476(n) = 2^i(n)*3^j(n); sequence gives values of j(n).

This page as a plain text file.
%I A064515 #13 Apr 21 2025 23:05:43
%S A064515 0,1,1,2,2,2,3,3,3,4,3,4,4,5,4,5,4,5,6,5,6,5,6,5,7,6,7,6,7,6,8,7,6,8,
%T A064515 7,8,7,9,8,7,9,8,7,9,8,10,9,8,10,9,8,10,9,11,8,10,9,11,10,9,11,10,12,
%U A064515 9,11,10,12,9,11,10,12,11,13,10,12,11,13,10,12,11,13,10,12,14,11,13,12
%N A064515 Write A064476(n) = 2^i(n)*3^j(n); sequence gives values of j(n).
%o A064515 (ARIBAS) function a064515(maxarg: integer); var j: integer; ar: array; begin ar := p2p3(maxarg); for j := 0 to maxarg - 1 do write(ar[j][2]," "); end; end; a064515(95);  (* For definition of function p2p3 see A064476. *)
%o A064515 (Python)
%o A064515 from sympy import integer_log
%o A064515 def A064515(n):
%o A064515     def bisection(f,kmin=0,kmax=1):
%o A064515         while f(kmax) > kmax: kmax <<= 1
%o A064515         kmin = kmax >> 1
%o A064515         while kmax-kmin > 1:
%o A064515             kmid = kmax+kmin>>1
%o A064515             if f(kmid) <= kmid:
%o A064515                 kmax = kmid
%o A064515             else:
%o A064515                 kmin = kmid
%o A064515         return kmax
%o A064515     def f(x): return n+x-sum(max(0,min((i<<1)+1,(x//3**i).bit_length())-i) for i in range(integer_log(x,3)[0]+1))
%o A064515     return integer_log((m:=bisection(f,n,n))>>(m-1&~m).bit_length(),3)[0] # _Chai Wah Wu_, Mar 26 2025
%Y A064515 Cf. A064476, A064514.
%K A064515 nonn,easy
%O A064515 1,4
%A A064515 _Vladeta Jovovic_, Oct 07 2001, Oct 07 2001
%E A064515 More terms from _Klaus Brockhaus_, Oct 12 2001