login
Nonnegative integers n with the property that the square of each digit of n is a substring of n^2.
1

%I #19 Dec 25 2014 15:40:29

%S 0,1,2,3,4,5,6,7,8,9,10,11,12,13,20,21,22,30,31,33,40,41,50,55,60,70,

%T 80,90,91,100,101,102,103,104,105,110,111,112,113,115,120,121,122,130,

%U 133,142,159,191,200,201,202,203,205,210,211,220,221,222,223,233,291,300

%N Nonnegative integers n with the property that the square of each digit of n is a substring of n^2.

%C From _Farideh Firoozbakht_, Dec 24 2014: (Start)

%C 1. If n is in the sequence then 10*n is in the sequence.

%C 2. All repdigit numbers with digits 1, 2, 3 and 5 are in the sequence. (End)

%H M. F. Hasler, <a href="/A173899/b173899.txt">Table of n, a(n) for n = 1..1000</a>

%e 91 is in the list because 9^2=81 and 1^2=1 are substrings of 91^2=8281.

%p for i from 0 to 9 do

%p Sq[sprintf("%d",i)]:= sprintf("%d",i^2)

%p od:

%p f:= proc(n)

%p uses StringTools;

%p local L,T;

%p L:= convert(Explode(sprintf("%d",n)),set);

%p T:= sprintf("%d",n^2);

%p andmap(t -> Search(Sq[t],T) <> 0,L);

%p end proc:

%p select(f, [$1..1000]); # _Robert Israel_, Dec 24 2014

%o (PARI) is(n)={!#setminus(setminus(apply(t->t^2,d=Set(digits(n))),Set(digits(n2=n^2))),Set(vector(#Str(n2)-1,i,n2\10^(i-1)%100)))} \\ _M. F. Hasler_, Dec 24 2014

%K base,nonn

%O 1,3

%A _Claudio Meller_, Mar 01 2010

%E Initial term a(1)=0 added by _M. F. Hasler_, Dec 25 2014