login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A124609
Position of the first 9 in the decimal expansion of the square root of n, or -1 if 9 never appears.
0
-1, -1, 15, 18, -1, 8, 4, 15, 15, -1, 16, 9, 24, 14, 14, 5, -1, 19, 13, 6, 8, 9, 3, 3, 3, -1, 3, 3, 3, 27, 22, 17, 10, 19, 5, 2, -1, 12, 11, 5, 20, 58, 9, 25, 7, 8, 7, 20, 2, -1, 33, 16, 11, 7, 7, 6, 24, 4, 14, 22, 5, 7, 19, 2, -1, 12, 14, 16, 18, 11, 19, 7, 18, 31, 22, 31, 6, 5, 29, 6, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1
OFFSET
0,3
PROG
(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); }
CROSSREFS
Sequence in context: A113968 A093812 A159840 * A102500 A067757 A063779
KEYWORD
base,easy,sign
AUTHOR
Cino Hilliard, Dec 22 2006, corrected Jul 18 2007
STATUS
approved