A090566 a(1) = 1; thereafter a(n) = smallest number > a(n-1) such that the concatenation of a(n-1) and a(n) is a square.
1, 6, 25, 281, 961, 6201, 59409, 187600, 730641, 4429444, 28600025, 85336064, 468650384, 4590568025, 23901253604, 36922256164, 228378872384, 519390415729, 3999576229761, 22053449580964, 52752598923921, 67153745961316, 346596997521321, 2205389504844676, 32117901134901281
Offset: 1
Links
- David W. Wilson and Robert G. Wilson v, Table of n, a(n) for n = 1..1840
Programs
-
Maple
A[1]:= 1: for n from 2 to 100 do x:= A[n-1]; d:= ilog10(x)+1; for dp from d while not assigned(A[n]) do if dp = d then ymin:= x+1 else ymin:= 10^(dp-1) fi; zmin:= 10^dp*x + ymin; r:= isqrt(zmin); if r^2 < zmin then z:= (r+1)^2 else z:= r^2 fi; if z <= 10^dp*x + 10^dp - 1 then A[n]:= z - 10^dp*x; fi od od: seq(A[i],i=1..100); # Robert Israel, Nov 22 2015
-
Mathematica
a[1] = 1; a[n_] := Block[{x = a[n - 1], d = 1 + Floor@ Log10@ a[n - 1]}, q = (Floor@ Sqrt[(10^d + 1) x] + 1)^2; If[q < (10^d) (x + 1), Mod[q, 10^d], Mod[(Floor@ Sqrt[(10^d)(10x + 1) -1] + 1)^2, 10^(d + 1)]]]; Array[a, 25] (* after the algorithm of David W. Wilson, Robert G. Wilson v, Nov 22 2015 *)
-
PARI
A090566(n,show=0,a=1)={for(i=2,n,show&&print1(a","); a=A243091(a));a} \\ Use 2nd optional arg to print out intermediate values, 3rd optional arg to use another starting value. - M. F. Hasler, Nov 22 2015, revised version based on A243091: Nov 24 2015
Formula
a(n+1) = A243091(a(n)). - M. F. Hasler, Nov 24 2015
Extensions
Corrected and extended by David W. Wilson, Nov 20 2015
Comments