Largest five adjacent number: Difference between revisions
Content added Content deleted
Line 54: | Line 54: | ||
maximum((evalpoly(10, dig[i:i + 4]) for i = 1:length(dig) - 4)) = 99993 |
maximum((evalpoly(10, dig[i:i + 4]) for i = 1:length(dig) - 4)) = 99993 |
||
</pre> |
</pre> |
||
Or, using strings: |
Or, using strings, and see Nigel's comment in the discussion: |
||
<lang julia>s = String(rand('0':'9', 1000)) |
|||
⚫ | |||
⚫ | |||
</lang>{{out}} |
|||
<pre> |
<pre> |
||
julia> setprecision(3324) |
|||
⚫ | |||
3324 |
|||
julia> s = string(BigFloat(pi))[3:end] |
|||
"141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365" ⋯ 180 bytes ⋯ "66940513200056812714526356082778577134275778960917363717872146844090122495343014654958537105079227968925892354201995611212902196086403441815981362977477130996051870721134999999837297804995105973173281609631859502445945534690830264252230825334468503526193118817101000313783875288658753320838142061717766914730359825349042875546873115956286388235378759375195778185778053217122680661300192787661119590921642019898" |
|||
⚫ | |||
("99999", 763) |
|||
⚫ | |||
⚫ | |||
</pre> |
</pre> |
||