HMMT 二月 2016 · 冲刺赛 · 第 33 题
HMMT February 2016 — Guts Round — Problem 33
题目详情
英文原题
- [ 20 ] (Lucas Numbers) The Lucas numbers are defined by L = 2, L = 1, and L = L + L
0 1 n +2 n +1 nfor every n ≥ 0. There are N integers 1 ≤ n ≤ 2016 such that L contains the digit 1. Estimate N .
An estimate of E earns b 20 − 2 | N − E |c or 0 points, whichever is greater.n
解析
英文解析
- [ 20 ] (Lucas Numbers) The Lucas numbers are defined by L = 2, L = 1, and L = L + L
0 1 n +2 n +1 nfor every n ≥ 0. There are N integers 1 ≤ n ≤ 2016 such that L contains the digit 1. Estimate N .
An estimate of E earns b 20 − 2 | N − E |c or 0 points, whichever is greater.n
Proposed by: Evan Chen
Answer: 1984
lucas_ones n = length . filter (elem ’1’) $ take (n + 1) lucas_strswherelucas = 2 : 1 : zip with (+) lucas (tail lucas)
lucas_strs = map show lucasmain = put str ln . show $ lucas_ones 2016