|
Search: id:A124604
|
|
|
| A124604 |
|
Position of the first 4 in the decimal expansion of the square root of n, or -1 if 4 never appears. |
|
+0 1
|
|
| -1, -1, 2, 23, -1, 11, 2, 3, 5, -1, 27, 7, 2, 11, 3, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 16, 8, 38, 7, 2, 7, 7, 3, 10, 18, -1, 25, 4, 3, 4, 2, 2, 5, 6, 11, 22, 7, 19, -1, 14, 3, 23, 26, 3, 2, 2, 3, 23, 6, 3, 6, 4, 22, -1, 9, 4, 14, 3, 16, 12, 2, 2, 3, 12, 7, 15, 4, 15, 7, 3, -1, 14, 5, 25, 6, 8, 18, 12, 2, 2, 10, 9, 3, 10, 3, 69, 3, 5, 3, -1
(list; graph; listen)
|
|
|
OFFSET
|
0,3
|
|
|
PROGRAM
|
(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: A060601 A053952 A052077 this_sequence A107801 A076653 A114008
Adjacent sequences: A124601 A124602 A124603 this_sequence A124605 A124606 A124607
|
|
KEYWORD
|
base,easy,sign
|
|
AUTHOR
|
Cino Hilliard (hillcino368(AT)hotmail.com), Dec 22 2006, corrected Jul 18 2007
|
|
|
Search completed in 0.002 seconds
|