返回题库

HMMT 二月 2016 · 冲刺赛 · 第 33 题

HMMT February 2016 — Guts Round — Problem 33

专题
Discrete Math / 离散数学
难度
L3
来源
HMMT

题目详情

  1. [ 20 ] (Lucas Numbers) The Lucas numbers are defined by L = 2, L = 1, and L = L + L 0 1 n +2 n +1 n for every n ≥ 0. There are N integers 1 ≤ n ≤ 2016 such that L contains the digit 1. Estimate N . n An estimate of E earns b 20 − 2 | N − E |c or 0 points, whichever is greater.
解析
  1. [ 20 ] (Lucas Numbers) The Lucas numbers are defined by L = 2, L = 1, and L = L + L 0 1 n +2 n +1 n for every n ≥ 0. There are N integers 1 ≤ n ≤ 2016 such that L contains the digit 1. Estimate N . n An estimate of E earns b 20 − 2 | N − E |c or 0 points, whichever is greater. Proposed by: Evan Chen Answer: 1984 lucas_ones n = length . filter (elem ’1’) $ take (n + 1) lucas_strs where lucas = 2 : 1 : zipWith (+) lucas (tail lucas) lucas_strs = map show lucas main = putStrLn . show $ lucas_ones 2016