login
Numbers n such that integer part of the square root of n appears as a substring in n.
2

%I #12 Jan 16 2025 20:35:03

%S 1,13,24,25,35,36,46,57,68,78,80,89,90,91,92,93,94,95,96,97,98,99,100,

%T 101,102,103,104,105,106,107,108,109,110,214,317,420,522,624,625,726,

%U 828,930,1032,1133,1235,1336,1360,1361,1362,1363,1364,1365,1366,1367

%N Numbers n such that integer part of the square root of n appears as a substring in n.

%C Includes all numbers from 10^(2*k)-10^k to 10^(2*k)+10^k. - _Robert Israel_, Nov 11 2018

%H Robert Israel, <a href="/A133785/b133785.txt">Table of n, a(n) for n = 1..10000</a>

%e a(2)=13 because int(sqrt(13))=3 and "3" occurs in "13".

%e a(7)=46 because int(sqrt(46))=6 and "6" occurs in "46".

%e a(38)=624 because int(sqrt(624))=24 and "24" occurs in "624".

%p filter:= proc(n) local S,T;

%p S:= sprintf("%d",n);

%p T:= sprintf("%d",floor(sqrt(n)));

%p StringTools[Search](T,S) <> 0

%p end proc:

%p select(filter, [$1..10000]); # _Robert Israel_, Nov 11 2018

%o (BASIC) FOR i& = 1 TO 1000000 s$ = MID$(STR$(INT(SQR(i&))), 2) IF INSTR(STR$(i&), s$) > 0 THEN PRINT i& END IF NEXT i&

%K easy,nonn,base

%O 1,2

%A _Gil Broussard_, Jan 02 2008