%I A124605
%S A124605 1,1,8,6,1,37,31,4,36,1,26,12,10,4,6,19,1,7,16,3,7,2,7,4,10,1,1,1,1,1,
1,1,1,1,1,1,
%T A124605 1,8,18,19,5,38,22,2,8,23,13,3,13,1,13,11,8,14,14,13,11,2,4,7,4,10,22,
6,1,6,13,4,9,
%U A124605 18,10,15,4,2,7,6,45,35,18,13,15,1,3,8,4,5,10,9,8,12,11,2,2,6,4,39,6,6,
16,17,1
%V A124605 -1,-1,8,6,-1,37,31,4,36,-1,26,12,10,4,6,19,-1,7,16,3,7,2,7,4,10,1,1,1,
1,1,1,1,1,1,1,1,
%W A124605 -1,8,18,19,5,38,22,2,8,23,13,3,13,-1,13,11,8,14,14,13,11,2,4,7,4,10,22,
6,-1,6,13,4,9,
%X A124605 18,10,15,4,2,7,6,45,35,18,13,15,-1,3,8,4,5,10,9,8,12,11,2,2,6,4,39,6,
6,16,17,-1
%N A124605 Position of the first 5 in the decimal expansion of the square root of
n, or -1 if 5 never appears.
%o A124605 (PARI) digitpos(n,m) = /* m-th digit in sqrt expansions */ { local(x,
y,r,dot); default(realprecision,1000); for(x=0,n, r = sqrt(x); if(issquare(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) = /* Revised 2007 */ { local(lnm,lns,tstr,vstr,x,j); vstr=Vec(Str(str));
match=Str(match); lns=length(str); lnm=length(match); for(x=1,lns-lnm+1,
tstr=""; for(j=x,x+lnm-1, tstr=concat(tstr,vstr[j]); ); if(match==tstr,
return(x)) ); return(0); }
%Y A124605 Sequence in context: A153493 A113212 A070483 this_sequence A021120 A021541
A066716
%Y A124605 Adjacent sequences: A124602 A124603 A124604 this_sequence A124606 A124607
A124608
%K A124605 base,easy,sign
%O A124605 0,3
%A A124605 Cino Hilliard (hillcino368(AT)hotmail.com), Dec 22 2006, corrected Jul
18 2007
|