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.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 64, 196, 361, 484, 841, 1936, 5929, 8836, 69696, 1999396, 29997529
Offset: 0

Views

Author

Amarnath Murthy, Mar 06 2002

Keywords

Comments

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,
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
(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.

Examples

			29997529 is a term since 29997529 and 30008484 are two consecutive squares with no common digits.
		

Programs

  • Maple
    s := X->convert(convert(X,base,10),set); seq(`if`((s(n^2) intersect s((n+1)^2))={},n^2,printf("")),n=1..350000);
  • Mathematica
    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]]]]]
    First /@ Select[Partition[Range[0, 6000]^2, 2, 1], Intersection @@ IntegerDigits /@ # == {} &] (* Jayanta Basu, Aug 06 2013 *)

Extensions

Edited by Dean Hickerson and Francois Jooste (phukraut(AT)hotmail.com), Mar 19 2002