login
a(n)^2 is smallest square beginning with n.
22

%I #53 Jul 17 2016 11:10:09

%S 0,1,5,6,2,23,8,27,9,3,10,34,11,37,12,39,4,42,43,14,45,46,15,48,49,5,

%T 51,52,17,54,55,56,18,58,59,188,6,61,62,63,20,203,65,66,21,213,68,69,

%U 22,7,71,72,23,73,74,235,75,24,241,77,78,247,25,251,8,81,257,26,83,263,84,267,27

%N a(n)^2 is smallest square beginning with n.

%C The following discussion is based on comments from _David A. Corneth_, _Robert Israel_, _N. J. A. Sloane_, and _Chai Wah Wu_. (Start)

%C As the graph shows, the points belong to various "curves". For each n there is a value d = d(n) such that n*10^d <= a(n)^2 < (n+1)*10^d, and so on this curve, a(n) ~ sqrt(n)*10^(d/2). The values of d(n) are given in A272677.

%C For a given n, d can range from 0 (if n is a square) to d_max, where it appears that d_max approx. equals 3 + floor( log_10(n/25) ). The successive points where d_max increases are given in A272678, and that entry contains more precise conjectures about the values.

%C For example, in the range 2600 = A272678(5) <= n < 25317 = A272678(6), d_max is 5. This is the upper curve in the graph that is seen if the "graph" button is clicked, and on this curve a(n) is about sqrt(n)*10^(5/2). (End)

%H N. J. A. Sloane, <a href="/A018851/b018851.txt">Table of n, a(n) for n = 0..20000</a>

%H Zak Seidov, <a href="http://zak08.livejournal.com/9621.html">Blog entry</a>

%H Zak Seidov, <a href="/A018851/a018851.pdf">Blog entry</a> [Cached copy, pdf format, with permission]

%F a(n) >= sqrt(n), for all n >= 0 with equality when n is a square. - _Derek Orr_, Jul 26 2015

%p f:= proc(n) local d,m;

%p for d from 0 do

%p m:= ceil(sqrt(10^d*n));

%p if m^2 < 10^d*(n+1) then return m fi

%p od

%p end proc:

%p map(f, [$1..100]); # _Robert Israel_, Jul 26 2015

%o (PARI) a(n)=k=1; while(k,d=digits(k^2); D=digits(n); if(#D<=#d,c=1; for(i=1,#D,if(D[i]!=d[i],c=0;break));if(c,return(k)));k++)

%o vector(100,n,a(n)) \\ _Derek Orr_, Jul 26 2015

%Y Cf. A018796 (the squares), A272677, A272678.

%Y A265432 is a more complicated sequence in the same spirit.

%K nonn,base,look

%O 0,3

%A _David W. Wilson_

%E Added initial 0. - _N. J. A. Sloane_, May 21 2016

%E Comments revised by _N. J. A. Sloane_, Jul 17 2016