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.

A264770 a(1) = 1, a(n) = smallest positive number not yet in the sequence such that the concatenation of a(n-1) and a(n) is a square.

This page as a plain text file.
%I A264770 #25 Jul 09 2025 04:40:20
%S A264770 1,6,4,9,61,504,100,489,2944,656,3844,34449,85636,516,961,6201,5625,
%T A264770 43524,36729,7225,344,569,2996,361,201,64,1601,6004,7001,316,84,681,
%U A264770 21,16,81,225,625,5001,3184,3449,2129,8225,424,36,481,636,804,609,1024,144
%N A264770 a(1) = 1, a(n) = smallest positive number not yet in the sequence such that the concatenation of a(n-1) and a(n) is a square.
%C A264770 For any x > 0, if d is large enough there are squares between 10^d*x + 10^(d-1) and 10^d*x + 10^d - 1.  Thus the sequence is infinite.
%C A264770 a(3) = 4 is the minimum value of a(n) for n > 1. - _Altug Alkan_, Nov 24 2015 (This is because no square can end in 2 or 3, so 2 and 3 can never appear in the sequence. - _N. J. A. Sloane_, Nov 24 2015)
%H A264770 Robert Israel, <a href="/A264770/b264770.txt">Table of n, a(n) for n = 1..10000</a>
%e A264770 For n = 6, a(n-1) = 61.  There are no squares of the form 61x or 61xy with x>=1.  The least square of the form 61xyz with x >= 1 is 61504, and 504 has not appeared previously so a(6) = 504.
%p A264770 S:= {1};
%p A264770 A[1]:= 1;
%p A264770 for n from 2 to 100 do
%p A264770    found:= false;
%p A264770    x:= A[n-1];
%p A264770    for d from 1 while not found do
%p A264770       a:= ceil(sqrt(10^d*x +10^(d-1)));
%p A264770       b:= floor(sqrt(10^d*x + 10^d - 1));
%p A264770       Q:= map(t -> t^2 - 10^d*x, {$a..b}) minus S;
%p A264770       if nops(Q) >= 1 then
%p A264770          A[n]:= min(Q);
%p A264770          S:= S union {A[n]};
%p A264770          found:= true;
%p A264770       fi
%p A264770    od
%p A264770 od:
%p A264770 seq(A[n],n=1..100);
%t A264770 (*to get B numbers of the sequence*) A={1};i=1;While[i<B,i++;m=Last[A];d=0;flag=0;While[flag==0,d++;g0=Ceiling[Sqrt[m*10^d+10^(d-1)]];h=(m+1)10^d;a=g0;Label[L$];If[a^2<h,b=a^2-m*10^d;If[MemberQ[A,b],a++;Goto[L$],flag=1;AppendTo[A,b]]]]];A (* _Emmanuel Vantieghem_, Nov 24 2015 *)
%o A264770 (PARI) A264770(n,show=0,a=1,u=[])={for(n=2, n, u=setunion(u,[a]); show&&print1(a", "); my(k=3); until(!setsearch(u, k++) && issquare(eval(Str(a,k))),);a=k); a} \\ Use optional 2nd, 3rd or 4th argument to print intermediate terms, use another starting value, or exclude some numbers. - _M. F. Hasler_, Nov 24 2015
%Y A264770 Cf.  A082209, A090566.
%K A264770 nonn,base
%O A264770 1,2
%A A264770 _Robert Israel_, Nov 24 2015, following a suggestion from _N. J. A. Sloane_