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.

Original entry on oeis.org

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
Offset: 1

Views

Author

Enoch Haga, Mar 18 2006

Keywords

Comments

"SOD" = "sum of digits".

Examples

			a(10) = 4. SOD(10)=1. 1 doubled is 2. Iterating: 2,4,8,16 -- 4 iterations of doubling 1 to exceed 10.
		

Crossrefs

Programs

  • BASIC
    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
  • Maple
    A117462 := proc(n)
        local x;
        x := digsum(n) ;
        max(1,ceil(log[2](n/x))) ;
    end proc:
    seq(A117462(n),n=1..90) ; # R. J. Mathar, Sep 24 2018
  • Mathematica
    Array[Max[1, Ceiling@ Log2[#/Total@ IntegerDigits@ #]] &, 105] (* Michael De Vlieger, Sep 24 2018 *)

Formula

Take n, calculate SOD, and count doubling iterations (at least 1) to equal or exceed n.
a(n) = max(1, log_2(n/A007953(n))). - R. J. Mathar, Sep 24 2018

Extensions

Re-engineered definition from BASIC program, and corrected/clarified the terms. - R. J. Mathar, Sep 24 2018