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.

A248127 Numbers whose squares became cubes if some digit is prepended, inserted or appended.

This page as a plain text file.
%I A248127 #31 Dec 31 2016 07:24:24
%S A248127 2,4,5,10,31,72,75,80,162,270,383,640,1250,2000,2160,3430,4000,5000,
%T A248127 5120,7290,10000,13310,17280,21970,27440,28875,31000,33750,40960,
%U A248127 49130,58320,68590,72000,75000,80000,92610
%N A248127 Numbers whose squares became cubes if some digit is prepended, inserted or appended.
%e A248127 If n = 10 then n^2 = 100 and if we append a 0 we have (1000)^1/3 = 10.
%e A248127 If n = 31 then n^2 = 961 and if we insert a 2 we have (9261)^1/3 = 21.
%e A248127 Again, if n = 112625 then n^2 = 12684390625 and if we insert an 8 we have (126884390625)^1/3 = 5025.
%p A248127 with(numtheory): P:=proc(q) local a, b, c, j, k, ok, n;
%p A248127 for n from 1 to q do a:=n^2; c:=ilog10(a)+1; ok:=1; for k from 0 to ilog10(a)+1 do
%p A248127 if ok=1 then for j from 0 to 9 do if not (k=c and j=0) then b:=trunc(a/10^k)*10^(k+1)+j*10^k+(a mod 10^k);
%p A248127 if b=trunc(evalf((b)^(1/3)))^3 then print(n); ok:=0; break; fi; fi; od; fi; od; od; end: P(10^9);
%t A248127 f[n_] := ! MissingQ@SelectFirst[Rest@Flatten[Outer[Insert[IntegerDigits[n^2], #2, #1] &, Range[IntegerLength[n^2] + 1], Range[0, 9]], 1], IntegerQ@CubeRoot@FromDigits@# &];
%t A248127 Select[Range[100], f] (* _Davin Park_, Dec 30 2016 *)
%Y A248127 Cf. A248051, A249853.
%K A248127 nonn,base
%O A248127 1,1
%A A248127 _Paolo P. Lava_, Nov 10 2014
%E A248127 Corrected by _Davin Park_, Dec 30 2016