|
|
A117462
|
|
The number of doubling steps of SOD(n) to exceed or equal n.
|
|
3
|
|
|
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, 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, 3, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 4
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,10
|
|
COMMENTS
|
"SOD" = "sum of digits".
|
|
LINKS
|
|
|
FORMULA
|
Take n, calculate SOD, and count doubling iterations (at least 1) to equal or exceed n.
|
|
EXAMPLE
|
a(10) = 4. SOD(10)=1. 1 doubled is 2. Iterating: 2,4,8,16 -- 4 iterations of doubling 1 to exceed 10.
|
|
MAPLE
|
local x;
x := digsum(n) ;
max(1, ceil(log[2](n/x))) ;
end proc:
|
|
MATHEMATICA
|
Array[Max[1, Ceiling@ Log2[#/Total@ IntegerDigits@ #]] &, 105] (* Michael De Vlieger, Sep 24 2018 *)
|
|
PROG
|
10 'use of str, mid, len, val
20 'number of doubled iterations required to equal or exceed sod(n)
30 C=C+1
40 D=str(C)
50 E=len(D)
60 for Q=2 to E
70 A=mid(D, Q, 1):G=val(A)
80 I=I+G
90 next Q
100 print C; I; "-";
110 K=I
120 I=0
130 for R=1 to C
140 K=K+K:T=T+1
150 if K>=C then print C; K; T:cancel for:stop:goto 170
160 next R
170 K=0:T=0
180 goto 30
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Re-engineered definition from BASIC program, and corrected/clarified the terms. - R. J. Mathar, Sep 24 2018
|
|
STATUS
|
approved
|
|
|
|