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.

A018797 Smallest cube that begins with n.

Original entry on oeis.org

0, 1, 27, 343, 4096, 512, 64, 729, 8, 9261, 1000, 110592, 125, 1331, 140608, 15625, 166375, 1728, 185193, 19683, 205379, 216, 226981, 238328, 24389, 250047, 262144, 27, 287496, 29791, 300763, 314432, 32768, 3375, 343, 35937, 3652264, 373248
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := For[idn = IntegerDigits[n]; k = 1, True, k++, idk = IntegerDigits[k^3]; If[Length[idn] <= Length[idk], If[idk[[1 ;; Length[idn]]] == idn, Return[k^3]]]]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 1000}] (* Jean-François Alcover, Mar 13 2016 *)
    id[n_]:=With[{idn=IntegerDigits[n]},idn==Take[IntegerDigits[#], Length[ idn]]&]; With[{c=Range[0,250]^3},Table[SelectFirst[c,id[k]],{k,0,40}]]//Quiet (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 08 2018 *)
  • Python
    for n in range(1, 10**3):
      for k in range(10**3):
        if str(k**3).startswith(str(n)):
          print(k**3, end=', ')
          break
      n += 1 # Derek Orr, Aug 03 2014

Formula

a(n) = A018852(n)^3. - Seiichi Manyama, Jan 30 2017

Extensions

Added initial 0. - Seiichi Manyama, Jan 30 2017