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.

A117462 The number of doubling steps of SOD(n) to exceed or equal n.

This page as a plain text file.
%I A117462 #24 Aug 20 2024 18:39:29
%S A117462 1,1,1,1,1,1,1,1,1,4,3,2,2,2,2,2,2,1,1,4,3,3,3,2,2,2,2,2,2,4,3,3,3,3,
%T A117462 3,2,2,2,2,4,4,3,3,3,3,3,3,2,2,4,4,3,3,3,3,3,3,3,3,4,4,3,3,3,3,3,3,3,
%U A117462 3,4,4,3,3,3,3,3,3,3,3,4,4,4,3,3,3,3,3,3,3,4
%N A117462 The number of doubling steps of SOD(n) to exceed or equal n.
%C A117462 "SOD" = "sum of digits".
%F A117462 Take n, calculate SOD, and count doubling iterations (at least 1) to equal or exceed n.
%F A117462 a(n) = max(1, log_2(n/A007953(n))). - _R. J. Mathar_, Sep 24 2018
%e A117462 a(10) = 4. SOD(10)=1. 1 doubled is 2. Iterating: 2,4,8,16 -- 4 iterations of doubling 1 to exceed 10.
%p A117462 A117462 := proc(n)
%p A117462     local x;
%p A117462     x := digsum(n) ;
%p A117462     max(1,ceil(log[2](n/x))) ;
%p A117462 end proc:
%p A117462 seq(A117462(n),n=1..90) ; # _R. J. Mathar_, Sep 24 2018
%t A117462 Array[Max[1, Ceiling@ Log2[#/Total@ IntegerDigits@ #]] &, 105] (* _Michael De Vlieger_, Sep 24 2018 *)
%o A117462 (BASIC)
%o A117462 10 'use of str,mid,len,val
%o A117462 20 'number of doubled iterations required to equal or exceed sod(n)
%o A117462 30 C=C+1
%o A117462 40 D=str(C)
%o A117462 50 E=len(D)
%o A117462 60 for Q=2 to E
%o A117462 70 A=mid(D,Q,1):G=val(A)
%o A117462 80 I=I+G
%o A117462 90 next Q
%o A117462 100 print C;I;"-";
%o A117462 110 K=I
%o A117462 120 I=0
%o A117462 130 for R=1 to C
%o A117462 140 K=K+K:T=T+1
%o A117462 150 if K>=C then print C;K;T:cancel for:stop:goto 170
%o A117462 160 next R
%o A117462 170 K=0:T=0
%o A117462 180 goto 30
%Y A117462 Cf. A007953, A117463.
%K A117462 easy,nonn,base
%O A117462 1,10
%A A117462 _Enoch Haga_, Mar 18 2006
%E A117462 Re-engineered definition from BASIC program, and corrected/clarified the terms. - _R. J. Mathar_, Sep 24 2018