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.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Dec 11 2003

Keywords

Comments

From David W. Wilson, Nov 22 2015: (Start)
I used the following algorithm to extend the sequence:
x = a(n);
d = number of digits in x;
p = (10^d + 1)*x; #concat(x, x)
q = (floor(sqrt(p)) + 1)^2; #smallest square > p
if (q < (10^d)(x + 1))
a(n+1) = q mod (10^d); #last d digits of q
else
p = (10^d)*(10x + 1); #concat(x, 10^d)
q = (floor(sqrt(p - 1)) + 1)^2; #smallest square >= p
a(n+1) = q mod (10^(d + 1)); #last d+1 digits of q.
(End)

Crossrefs

See A082209 for another version. Cf. A243091.

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