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.

A248051 Numbers whose cubes become squares if some digit is prepended, inserted or appended.

This page as a plain text file.
%I A248051 #78 Mar 03 2019 01:54:26
%S A248051 1,2,5,6,10,25,30,40,41,60,84,90,96,100,121,129,160,169,200,201,250,
%T A248051 266,360,400,490,500,600,640,724,810,1000,1025,1210,1440,1690,1960,
%U A248051 2250,2500,2560,2890,3000,3240,3604,3610,4000,4100,4410,4840,5216,5290,5760
%N A248051 Numbers whose cubes become squares if some digit is prepended, inserted or appended.
%C A248051 No leading zeros allowed.
%C A248051 Number of terms <= 10^k for k = 0, 1, 2, ...: 1, 5, 14, 31, 64, 144, 373, ..., . _Robert G. Wilson v_, Dec 27 2016
%H A248051 Robert G. Wilson v, <a href="/A248051/b248051.txt">Table of n, a(n) for n = 1..373</a> (terms 1..100 from Paolo P. Lava, terms 101..144 from Davin Park)
%e A248051 If n = 1 then n^3 = 1 and if we append a 6 we have sqrt(16) = 4.
%e A248051 If n = 2 then n^3 = 8 and if we append a 1 we have sqrt(81) = 9.
%e A248051 If n = 5 then n^3 = 125 and if we insert a 2 we get sqrt(1225) = 35.
%e A248051 Again, if n = 25 then n^3 = 15625 and we have sqrt(105625) = 325 or sqrt(156025) = 395.
%p A248051 with(numtheory): P:=proc(q) local a,b,j,k,n,ok;
%p A248051 for n from 1 to q do a:=n^3; b:=ilog10(a)+1; ok:=1;
%p A248051 for k from 0 to b do if ok=1 then for j from 0 to 9 do
%p A248051 if not (j=0 and k=b) then if type(sqrt(trunc(a/10^k)*10^(k+1)+j*10^k+(a mod 10^k)),integer)
%p A248051 then print(n); ok:=0; break; fi; fi; od; fi;
%p A248051 od; od; end: P(10^6);
%t A248051 f[n_] := ! MissingQ@SelectFirst[Rest@Flatten[Outer[Insert[IntegerDigits[n^3], #2, #1] &, Range[IntegerLength[n^3] + 1], Range[0, 9]], 1], IntegerQ@Sqrt@FromDigits@# &];
%t A248051 Select[Range[100], f] (* _Davin Park_, Dec 28 2016 *)
%Y A248051 Cf. A248127, A249853.
%K A248051 nonn,base
%O A248051 1,2
%A A248051 _Paolo P. Lava_, Nov 10 2014
%E A248051 Corrected and extended by _Davin Park_, Dec 26 2016
%E A248051 Extended by _Robert G. Wilson v_, Dec 27 2016