OFFSET
0,2
COMMENTS
Records occur at: 0, 1, 4, 5, 8, 9, 13, 16, 21, 24, 35, 42, 52, 58, 67, 75, 80, ..., . - Robert G. Wilson v, Nov 23 2015
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 0..1000
EXAMPLE
a(1) = 6 since 6>1 and 16 = 4^2.
a(2) = 5 since 5>2 and 25 = 5^2.
MATHEMATICA
f[n_] := Block[{x = n, d = 1 + Floor@ Log10@ n}, q = (Floor@ Sqrt[(10^d + 1) x] + 1)^2; If[q < (10^d) (x + 1), Mod[q, 10^d], Mod[(Floor@ Sqrt[(10^d) (10 x + 1) - 1] + 1)^2, 10^(d + 1)]]]; Array[f, 65] (* Robert G. Wilson v, Nov 23 2015, after the algorithm of David W. Wilson in A090566 *)
lnk[n_]:=Module[{k=n+1}, While[!IntegerQ[Sqrt[n 10^IntegerLength[k]+k]], k++]; k]; Array[lnk, 70, 0] (* Harvey P. Dale, Sep 01 2023 *)
PROG
(PARI) a(n)=s=Str(n); k=n+1; while(!issquare(eval(concat(s, Str(k)))), k++); return(k)
vector(100, n, a(n))
(PARI) A048761 = t->(sqrtint(t-1)+1)^2
A243091(n)={my(d=#Str(n), a=A048761((1+10^d)*n)); a>=(n+1)*10^d && a=A048761((n*10+1)*10^d); a%10^(d+(a>=100^d))} \\ M. F. Hasler, Nov 24 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Derek Orr, Aug 18 2014
EXTENSIONS
a(0)=1 added by N. J. A. Sloane, Nov 24 2015
STATUS
approved