login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A322667
a(n) is the smallest positive integer k such that floor((k + 1)^2/10^n) - floor(k^2/10^n) = 2.
2
7, 59, 531, 5099, 50316, 500999, 5003162, 50009999, 500031622, 5000099999, 50000316227, 500000999999, 5000003162277, 50000009999999, 500000031622776, 5000000099999999, 50000000316227766, 500000000999999999, 5000000003162277660, 50000000009999999999
OFFSET
1,1
COMMENTS
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.
FORMULA
a(n) = 5*10^(n-1) + ceiling(10^(n/2)) - 1 for n >= 2.
EXAMPLE
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.
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.
PROG
(PARI) a(n) = if(n==1, 7, 5*10^(n-1) + ceil(10^(n/2)) - 1)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jianing Song, Dec 22 2018
STATUS
approved