Maths Olympiad Prep

Library / /40 of 1394

Algebra Difficulty 4.6 AIME Find the answer United States

Problem:

The Lucas numbers are defined by L0=2L_{0} = 2, L1=1L_{1} = 1, and Ln+2=Ln+1+LnL_{n+2} = L_{n+1} + L_{n} for every n0n \geq 0. There are NN integers 1n20161 \leq n \leq 2016 such that LnL_{n} contains the digit 11. Estimate NN.

An estimate of EE earns 202NE\lfloor 20 - 2|N - E| \rfloor or 00 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\text{n = length filter ( elem '1') take (n+1) lucas strs}

where

lucas=2:1:zipWith (+) lucas (tail lucas)\text{lucas} = 2 : 1 : \text{zipWith}~(+)~\text{lucas}~(\text{tail}~\text{lucas})

lucas strs = map show lucas\text{lucas strs = map show lucas}

main = putStrLn show lucas ones 2016\text{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.