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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

1, 2, 5, 6, 10, 25, 30, 40, 41, 60, 84, 90, 96, 100, 121, 129, 160, 169, 200, 201, 250, 266, 360, 400, 490, 500, 600, 640, 724, 810, 1000, 1025, 1210, 1440, 1690, 1960, 2250, 2500, 2560, 2890, 3000, 3240, 3604, 3610, 4000, 4100, 4410, 4840, 5216, 5290, 5760
Offset: 1

Views

Author

Paolo P. Lava, Nov 10 2014

Keywords

Comments

No leading zeros allowed.
Number of terms <= 10^k for k = 0, 1, 2, ...: 1, 5, 14, 31, 64, 144, 373, ..., . Robert G. Wilson v, Dec 27 2016

Examples

			If n = 1 then n^3 = 1 and if we append a 6 we have sqrt(16) = 4.
If n = 2 then n^3 = 8 and if we append a 1 we have sqrt(81) = 9.
If n = 5 then n^3 = 125 and if we insert a 2 we get sqrt(1225) = 35.
Again, if n = 25 then n^3 = 15625 and we have sqrt(105625) = 325 or sqrt(156025) = 395.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,b,j,k,n,ok;
    for n from 1 to q do a:=n^3; b:=ilog10(a)+1; ok:=1;
    for k from 0 to b do if ok=1 then for j from 0 to 9 do
    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)
    then print(n); ok:=0; break; fi; fi; od; fi;
    od; od; end: P(10^6);
  • Mathematica
    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@# &];
    Select[Range[100], f] (* Davin Park, Dec 28 2016 *)

Extensions

Corrected and extended by Davin Park, Dec 26 2016
Extended by Robert G. Wilson v, Dec 27 2016
Showing 1-1 of 1 results.