|
|
A124603
|
|
Position of the first 3 in the decimal expansion of the square root of n, or -1 if 3 never appears.
|
|
0
|
|
|
-1, -1, 7, 3, -1, 3, 13, 8, 22, 1, 1, 1, 1, 1, 1, 1, -1, 4, 36, 2, 6, 28, 13, 6, 14, -1, 10, 15, 22, 2, 18, 8, 14, 12, 3, 10, -1, 9, 26, 11, 2, 4, 18, 6, 3, 7, 5, 21, 7, -1, 25, 23, 21, 23, 2, 23, 4, 6, 7, 30, 15, 17, 24, 3, -1, 20, 6, 5, 12, 2, 2, 10, 8, 7, 5, 9, 14, 8, 3, 11, 21, -1, 5, 6, 8, 17, 4, 2, 2, 3, 6, 3, 7, 4, 5, 8, 12, 42, 9, 8, -1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
|
|
MATHEMATICA
|
Table[Position[RealDigits[Sqrt[n], 10, 100][[1]], 3, 1, 1], {n, 0, 100}]/.{}->-1//Flatten (* Harvey P. Dale, May 02 2023 *)
|
|
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
|
|
|
KEYWORD
|
base,easy,sign
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|