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.

A245631 Least number k such that n concatenated with k produces a cube.

This page as a plain text file.
%I A245631 #19 Feb 15 2023 21:17:04
%S A245631 25,7,43,913,12,4,29,5184,261,648,7649,5,31,8877,625,6375,28,5193,683,
%T A245631 5379,6,6981,8328,389,15456,2144,44,7496,791,48625,4432,768,75,3,937,
%U A245631 52264,3248,9017,304,96,73281,875,8976,10944,6533,656,4552,26809,13,653,2,68024,1441,872,1368,39752,1787,32,319
%N A245631 Least number k such that n concatenated with k produces a cube.
%H A245631 Chai Wah Wu, <a href="/A245631/b245631.txt">Table of n, a(n) for n = 1..10000</a> (n = 1..1000 from Jens Kruse Andersen)
%e A245631 20, 21, 22, 23, 24, 25, and 26 are not cubes. 27 is a cube. Thus a(2) = 7.
%t A245631 lnc[n_]:=Module[{k=1},While[!IntegerQ[Surd[n*10^IntegerLength[k]+k,3]],k++];k]; Array[lnc,60] (* _Harvey P. Dale_, Aug 08 2019 *)
%o A245631 (PARI)
%o A245631 a(n)=p="";for(k=0,10^6,p=concat(Str(n),Str(k));if(ispower(eval(p))&&ispower(eval(p))%3==0,return(k)))
%o A245631 n=1;while(n<100,print1(a(n),", ");n++)
%o A245631 (Python)
%o A245631 from sympy import integer_nthroot
%o A245631 def A245631(n):
%o A245631     m = 10*n
%o A245631     if integer_nthroot(m,3)[1]: return 0
%o A245631     a = 1
%o A245631     while (k:=(integer_nthroot(a*(m+1)-1,3)[0]+1)**3-m*a)>=10*a:
%o A245631         a *= 10
%o A245631     return k # _Chai Wah Wu_, Feb 15 2023
%Y A245631 Cf. A071176.
%K A245631 nonn,base
%O A245631 1,1
%A A245631 _Derek Orr_, Jul 27 2014