login
a(n) = the largest number one can subtract from 10^n such that the square of the result is strictly greater than 10^(2*n-1).
0

%I #1 May 11 2007 03:00:00

%S 6,68,683,6837,68377,683772,6837722,68377223,683772233,6837722339,

%T 68377223398,683772233983,6837722339831,68377223398316,

%U 683772233983162,6837722339831620,68377223398316206,683772233983162066

%N a(n) = the largest number one can subtract from 10^n such that the square of the result is strictly greater than 10^(2*n-1).

%C Let a(n) := max{ a in N: (10^n-a)^2 > 10^(2*n-1) } then a(n) = floor(10^n*(1-sqrt(0.1))) is easily obtained by solving a quadratic equation. When proving that a(n) satisfies the definition, one has to use the following inequality, due to the fact that 10^n*(1-sqrt(0.1)) is never an integer: floor(10^n*(1-sqrt(0.1))) < 10^n*(1-sqrt(0.1)).

%C The exponent (2*n - 1) in the definition of the sequence was chosen because with a number of n decimal digits, the greater of the two possible lengths obtained when squaring it is 2*n. Since 10^(2*n-1) is the smallest decimal number with 2*n digits, (10^n - a(n)) gives the minimum number to obtain the maximum length by squaring it.

%F a(n) = floor(10^n*(1-sqrt(0.1))) That means that a(n) gives the decimal expansion of 1-sqrt(0.1).

%e a(1) = 6 because (10-6)^2 = 4^2 > 10 = 10^(2*1-1) whereas (10-7)^2 = 3^2 <= 10.

%e a(2) = 68 because (100-68)^2 = 32^2 > 1000 = 10^(2*2-1) whereas

%e (100-69)^2 = 31^2 <= 1000.

%p for n from 1 to 31 do floor(10^n * (1-sqrt(0.1))); od;

%K nonn

%O 1,1

%A Peter C. Heinig (algorithms(AT)gmx.de), Apr 18 2007, Apr 22 2007, Apr 23 2007