%I A124685
%S A124685 1,1,8,10,6,3,7,18,1,2,10,7,12,13,4,8,8,10,4,6,15,16,3,27,10,5,8,1,2,2,
3,7,6,3,9,5,
%T A124685 3,19,9,11,21,10,5,3,4,9,5,3,35,6,5,3,25,14,21,3,18,6,4,16,26,12,9,5,1,
2,2,2,2,3,12,4,
%U A124685 4,20,12,12,33,7,34,4,3,10,18,5,24,21,5,5,7,8,6,25,14,4,21,6,10,6,4,5,
22
%V A124685 1,-1,8,10,6,3,7,18,-1,2,10,7,12,13,4,8,8,10,4,6,15,16,3,27,10,5,8,-1,
2,2,3,7,6,3,9,5,
%W A124685 3,19,9,11,21,10,5,3,4,9,5,3,35,6,5,3,25,14,21,3,18,6,4,16,26,12,9,5,-1,
2,2,2,2,3,12,4,
%X A124685 4,20,12,12,33,7,34,4,3,10,18,5,24,21,5,5,7,8,6,25,14,4,21,6,10,6,4,5,
22
%N A124685 Position of the first 0 in the decimal expansion of the cube root of
n, or -1 if this digit never appears.
%o A124685 (PARI) digitposcbrt(n,m) = \ cbrt expansion { local(x,y,r,dot); for(x=0,
n, r = (x^(1/3)); if(iscube(x), y=find(Str(floor(r)),m), y=find(Str(r),
m); dot=find(Str(r),"."); if(dot < y, y--); ); if(y, print1(y","),
print1(-1",") ) ) } find(str,match) = \Return the position of the
first occurrence of string \match in string str { local(lnm,lns,x,
c,i); str=Str(str); \This allows leaving quotes off input match=Str(match);
c=0; i=0; lns=length(str); lnm=length(match); if(lnm>1,i=1); x=1;
while(x<=lns-lnm+1, if(mid(str,x,lnm)== match,break,x++); ); if(x>
lns,return(0),return(x)) } mid(str,s,n) = \ Get a substring of length
n from string str starting at position s in str. { local(v,ln,x,tmp);
v =""; tmp = Vec(str); ln=length(tmp); for(x=s,s+n-1, v=concat(v,
tmp[x]); ); return(v) } iscube(n) = { local(r); r = n^(1/3); if(floor(r+.5)^3==
n,1,0) }
%Y A124685 Sequence in context: A038704 A112590 A105386 this_sequence A105021 A088487
A010733
%Y A124685 Adjacent sequences: A124682 A124683 A124684 this_sequence A124686 A124687
A124688
%K A124685 base,easy,sign
%O A124685 0,3
%A A124685 Cino Hilliard (hillcino368(AT)hotmail.com), Dec 24 2006
|