cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A090566 #62 Nov 28 2015 19:18:01
%S A090566 1,6,25,281,961,6201,59409,187600,730641,4429444,28600025,85336064,
%T A090566 468650384,4590568025,23901253604,36922256164,228378872384,
%U A090566 519390415729,3999576229761,22053449580964,52752598923921,67153745961316,346596997521321,2205389504844676,32117901134901281
%N 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.
%C A090566 From _David W. Wilson_, Nov 22 2015: (Start)
%C A090566 I used the following algorithm to extend the sequence:
%C A090566 x = a(n);
%C A090566 d = number of digits in x;
%C A090566 p = (10^d + 1)*x;                         #concat(x, x)
%C A090566 q = (floor(sqrt(p)) + 1)^2;               #smallest square > p
%C A090566 if (q < (10^d)(x + 1))
%C A090566         a(n+1) = q mod (10^d);            #last d digits of q
%C A090566 else
%C A090566         p = (10^d)*(10x + 1);             #concat(x, 10^d)
%C A090566         q = (floor(sqrt(p - 1)) + 1)^2;   #smallest square >= p
%C A090566         a(n+1) = q mod (10^(d + 1));      #last d+1 digits of q.
%C A090566 (End)
%H A090566 David W. Wilson and Robert G. Wilson v, <a href="/A090566/b090566.txt">Table of n, a(n) for n = 1..1840</a>
%F A090566 a(n+1) = A243091(a(n)). - _M. F. Hasler_, Nov 24 2015
%p A090566 A[1]:= 1:
%p A090566 for n from 2 to 100 do
%p A090566   x:= A[n-1];
%p A090566   d:= ilog10(x)+1;
%p A090566   for dp from d while not assigned(A[n]) do
%p A090566     if dp = d then
%p A090566       ymin:= x+1
%p A090566     else
%p A090566       ymin:= 10^(dp-1)
%p A090566     fi;
%p A090566     zmin:= 10^dp*x + ymin;
%p A090566     r:= isqrt(zmin);
%p A090566     if r^2 < zmin then z:= (r+1)^2
%p A090566     else z:= r^2
%p A090566     fi;
%p A090566     if z <= 10^dp*x + 10^dp - 1 then
%p A090566         A[n]:= z - 10^dp*x;
%p A090566     fi
%p A090566   od
%p A090566 od:
%p A090566 seq(A[i],i=1..100); # _Robert Israel_, Nov 22 2015
%t A090566 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 *)
%o A090566 (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
%Y A090566 See A082209 for another version. Cf. A243091.
%K A090566 nonn,base
%O A090566 1,2
%A A090566 _Amarnath Murthy_, Dec 11 2003
%E A090566 Corrected and extended by _David W. Wilson_, Nov 20 2015