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.

This page as a plain text file.
%I A018797 #35 Oct 06 2024 20:43:33
%S A018797 0,1,27,343,4096,512,64,729,8,9261,1000,110592,125,1331,140608,15625,
%T A018797 166375,1728,185193,19683,205379,216,226981,238328,24389,250047,
%U A018797 262144,27,287496,29791,300763,314432,32768,3375,343,35937,3652264,373248
%N A018797 Smallest cube that begins with n.
%H A018797 Seiichi Manyama, <a href="/A018797/b018797.txt">Table of n, a(n) for n = 0..10000</a> (terms 1..1000 from T. D. Noe)
%F A018797 a(n) = A018852(n)^3. - _Seiichi Manyama_, Jan 30 2017
%t A018797 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 *)
%t A018797 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 *)
%o A018797 (Python)
%o A018797 for n in range(1, 10**3):
%o A018797   for k in range(10**3):
%o A018797     if str(k**3).startswith(str(n)):
%o A018797       print(k**3, end=', ')
%o A018797       break
%o A018797   n += 1 # _Derek Orr_, Aug 03 2014
%Y A018797 Cf. A018852, A018796.
%K A018797 nonn,base,nice
%O A018797 0,3
%A A018797 _David W. Wilson_
%E A018797 Added initial 0. - _Seiichi Manyama_, Jan 30 2017