login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Consecutive exclusionary squares: Numbers n such that n^2 does not contain digits of n and (n+1)^2 does not contain digits of n+1.
1

%I #17 Nov 30 2014 15:06:24

%S 2,3,7,8,17,33,38,53,57,58,157,187,237,313,333,557,558,672,688,738,

%T 787,788,812,813,853,1557,2087,2107,2112,3112,3113,3157,3333,3357,

%U 3358,4453,4553,5598,5857,6672,6688,7017,7287,7772,7888,7908,8087,8337,15787,17157,18557,22112,32358

%N Consecutive exclusionary squares: Numbers n such that n^2 does not contain digits of n and (n+1)^2 does not contain digits of n+1.

%H Derek Orr, <a href="/A247843/b247843.txt">Table of n, a(n) for n = 1..53</a>

%o (Python)

%o for n in range(10**5):

%o ..s,t = str(n),str(n+1)

%o ..s2,t2 = str(n**2),str((n+1)**2)

%o ..c = 0

%o ..for i in s:

%o ....if s2.count(i):

%o ......c += 1

%o ......break

%o ..for j in t:

%o ....if t2.count(j):

%o ......c += 1

%o ......break

%o ..if not c:

%o ....print(n,end=', ')

%Y Cf. A029783.

%K nonn,base

%O 1,1

%A _Derek Orr_, Sep 25 2014