login
a(n) is the smallest positive integer k such that floor((k + 1)^2/10^n) - floor(k^2/10^n) = 2.
2

%I #9 May 26 2019 19:32:45

%S 7,59,531,5099,50316,500999,5003162,50009999,500031622,5000099999,

%T 50000316227,500000999999,5000003162277,50000009999999,

%U 500000031622776,5000000099999999,50000000316227766,500000000999999999,5000000003162277660,50000000009999999999

%N a(n) is the smallest positive integer k such that floor((k + 1)^2/10^n) - floor(k^2/10^n) = 2.

%C For n >= 2, note that when k < 5*10^(n-1) we have (k + 1)^2 - k^2 = 2*k + 1 < 10^n, so a(n) >= 5*10^(n-1). For 0 <= t < sqrt(10^n), floor((5*10^(n-1) + t)^2/10^n) = 25*10^(n-2) + t; for t = ceiling(sqrt(10^n)), floor((5*10^(n-1) + t)^2/10^n) = 25*10^(n-2) + t + 1. Take n = 3 as an example. When k < 500, (k + 1)^2 - k^2 < 1000, so a(3) >= 500. Since 31^2 = 961 < 1000, 32^2 = 1024 > 1000, (500 + t)^2 is successively 251001, 252004, ..., 281961, 283024, so a(3) = 500 + 31 = 531.

%F a(n) = 5*10^(n-1) + ceiling(10^(n/2)) - 1 for n >= 2.

%e floor(7^2/10) = 4, floor(8^2/10) = 6, and 7 is the smallest k such that floor((k + 1)^2/10) - floor(k^2/10) = 2, so a(1) = 7.

%e floor(59^2/10) = 34, floor(60^2/10) = 36, and 59 is the smallest k such that floor((k + 1)^2/100) - floor(k^2/100) = 2, so a(2) = 59.

%o (PARI) a(n) = if(n==1, 7, 5*10^(n-1) + ceil(10^(n/2)) - 1)

%Y Cf. A017936, A317774, A322666.

%K nonn

%O 1,1

%A _Jianing Song_, Dec 22 2018