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.

A068802 Smaller of two consecutive squares which have no common digits.

This page as a plain text file.
%I A068802 #11 Jun 24 2014 01:08:23
%S A068802 0,1,4,9,16,25,36,64,196,361,484,841,1936,5929,8836,69696,1999396,
%T A068802 29997529
%N A068802 Smaller of two consecutive squares which have no common digits.
%C A068802 There are no more terms. Sketch of proof: Suppose n^2 and (n+1)^2 have no common digits. Then their first digits differ, so n+1 = ceiling(sqrt(d*10^r)) with 1<=d<=9 and r>=0. In other words,
%C A068802 n+1 = ceiling(sqrt(e*100^s)) with e in {1,2,...,9,10,20,...,90} and s>=0. The cases e=1, 4 and 9 are easy. Otherwise note that about half the digits of (n+1)^2 equal 0, so n^2 has no 0's. We have
%C A068802 (n+1)^2 - n^2 = 2n+1 ~ 10^s*2*sqrt(e). For e=20, this is about 10^s * 8.94427190999916. So for s>=10, the decimal expansion of (n+1)^2 - n^2 has 2 consecutive 9's. (In fact 4 for large s, but 2 is enough.) Since n^2 has no 0's this implies that n^2 and (n+1)^2 have the same digit in the position of the first of the 2 9's. The same idea works for other values of e, but the consecutive 9's occur later.
%e A068802 29997529 is a term since 29997529 and 30008484 are two consecutive squares with no common digits.
%p A068802 s := X->convert(convert(X,base,10),set); seq(`if`((s(n^2) intersect s((n+1)^2))={},n^2,printf("")),n=1..350000);
%t A068802 For[lastn=-1; r=0, r<500, r++, For[d=1, d<10, d++, n=Ceiling[Sqrt[d*10^r]]-1; If[n>lastn, lastn=n; If[Intersection[IntegerDigits[n^2], IntegerDigits[(n+1)^2]]=={}, Print[n^2]]]]]
%t A068802 First /@ Select[Partition[Range[0, 6000]^2, 2, 1], Intersection @@ IntegerDigits /@ # == {} &] (* _Jayanta Basu_, Aug 06 2013 *)
%K A068802 base,fini,full,nonn
%O A068802 0,3
%A A068802 _Amarnath Murthy_, Mar 06 2002
%E A068802 Edited by _Dean Hickerson_ and Francois Jooste (phukraut(AT)hotmail.com), Mar 19 2002