POJ 2739 Sum of Consecutive Prime Numbers 已翻译
2016-12-16 18:50
316 查看
描述
一些正整数可以由一个或多个连续素数的和表示。给定的正整数有多少个这样的表示?例如,整数53具有两个表示5
+ 7 + 11 + 13 + 17和53.整数41具有三个表示2 + 3 + 5 + 7 + 11 + 13,11 + 13 + 17和41。图3仅具有一个表示,其为3.整数20没有这样的表示。请注意,summands必须是连续的素数
数字,因此7 + 13和3 + 5 + 5 + 7都不是整数20的有效表示。
你的任务是编写一个程序,报告给定的正整数的表示数量。
输入
输入是一个正整数序列,每个都在单独的行中。整数在2和10 000之间,包括2和10 000。输入的结束由零指示。
输出
输出应该由每个对应于除最后一个零之外的输入线的线组成。输出线包括作为一个或多个连续质数之和的输入整数的表示的数量。输出中不应插入其他字符。
相关文章推荐
- poj 2739 Sum of Consecutive Prime Numbers 解题报告
- POJ 2739 Sum of Consecutive Prime Numbers
- POJ 2739 Sum of Consecutive Prime Numbers
- POJ 2739 Sum of Consecutive Prime Numbers
- POJ2739 - Sum of Consecutive Prime Numbers(素数问题)
- POJ-2739-Sum of Consecutive Prime Numbers
- 【POJ-2739】Sum of Consecutive Prime Numbers
- poj 2739 Sum of Consecutive Prime Numbers
- POJ 2739 Sum of Consecutive Prime Numbers
- POJ 2739 Sum of Consecutive Prime Numbers
- POJ 2739 Sum of Consecutive Prime Numbers
- poj 2739 Sum of Consecutive Prime Numbers
- POJ 2739 Sum of Consecutive Prime Numbers
- 【原】 POJ 2739 Sum of Consecutive Prime Numbers 筛素数+积累数组 解题报告
- POJ 2739 Sum of Consecutive Prime Numbers
- POJ 2739 Sum of Consecutive Prime Numbers(素数表)
- POJ-2739-Sum of Consecutive Prime Numbers
- poj 2739 Sum of Consecutive Prime Numbers
- poj 2739 Sum of Consecutive Prime Numbers
- poj 2739 Sum of Consecutive Prime Numbers