A125117 First differences of A034887.
0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0
Offset: 0
Examples
a(1)=0 because 2^(1+1)=4 (one digit) 2^1=2 (one digit) and the difference is 0. a(3)=1 because 2^(3+1)=16 (two digits) 2^(3)=8 (one digit) and the difference is 1.
Links
- Paolo Xausa, Table of n, a(n) for n = 0..10000
Programs
-
Maple
P:=proc(n) local i,j,k,w,old; k:=2; for i from 1 by 1 to n do j:=k^i; w:=0; while j>0 do w:=w+1; j:=trunc(j/10); od; if i>1 then print(w-old); old:=w; else old:=w; fi; od; end: P(1000);
-
Mathematica
Differences[IntegerLength[2^Range[0, 100]]] (* Paolo Xausa, Jun 08 2024 *)
-
PARI
a(n)=logint(2^(n+1),10)-logint(2^n,10) \\ Charles R Greathouse IV, Oct 19 2016
Formula
a(n) = number_of_digits{2^(n+1)} - number_of_digits{2^(n)} with n>=0.
Comments