AlgebraDifficulty 4.6AIMEFind the answerUnited States
Problem:
The Lucas numbers are defined by L0=2, L1=1, and Ln+2=Ln+1+Ln for every n≥0. There are N integers 1≤n≤2016 such that Ln contains the digit 1. Estimate N.
An estimate of E earns ⌊20−2∣N−E∣⌋ or 0 points, whichever is greater.
A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.
Solution
Solution:
lucas_ones n = length filter ( elem ’1’) take (n+1) lucas strs
where
lucas=2:1:zipWith(+)lucas(taillucas)
lucas strs = map show lucas
main = putStrLn show lucas ones 2016
Want a route through all this instead of an archive? The track
puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.
Source: MathNet,
licensed CC-BY-4.0.
Statement reproduced verbatim; metadata (topic, difficulty) added by this project.