自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

LzyRapX

https://github.com/LzyRapx

  • 博客(99)
  • 问答 (1)
  • 收藏
  • 关注

原创 Problem 50 Consecutive prime sum (线性筛)

Consecutive prime sumProblem 50The prime 41, can be written as the sum of six consecutive primes:41 = 2 + 3 + 5 + 7 + 11 + 13This is the longest sum of consecutive primes that adds to

2016-10-31 19:58:20 646

原创 Problem 49 Prime permutations (set + vector)

Prime permutationsProblem 49The arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases by 3330, is unusual in two ways: (i) each of the three terms are prime, and, (ii

2016-10-31 19:56:50 391

原创 Problem 48 Self powers (技巧)

Self powersProblem 48The series, 11 + 22 + 33 + ... + 1010 = 10405071317.Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.Answer:9110

2016-10-31 19:55:08 546

原创 Problem 47 Distinct primes factors (分解因子)

Distinct primes factorsProblem 47The first two consecutive numbers to have two distinct prime factors are:14 = 2 × 715 = 3 × 5The first three consecutive numbers to have three distin

2016-10-31 19:53:12 813

原创 Problem 46 Goldbach's other conjecture (暴力...)

Goldbach's other conjectureProblem 46It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square.9 = 7 + 2×1215 = 7 +

2016-10-31 19:51:37 467

原创 Problem 45 Triangular, pentagonal, and hexagonal (暴力)

Triangular, pentagonal, and hexagonalProblem 45Triangle, pentagonal, and hexagonal numbers are generated by the following formulae:TriangleTn=n(n+1)/21, 3, 6, 10, 15, .

2016-10-30 20:18:50 382

原创 Problem 44 Pentagon numbers (暴力...)

Pentagon numbersProblem 44Pentagonal numbers are generated by the formula, Pn=n(3n−1)/2. The first ten pentagonal numbers are:1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ...It can be see

2016-10-30 16:23:53 610

原创 Problem 43 Sub-string divisibility (暴力...)

Sub-string divisibilityProblem 43The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interestin

2016-10-30 15:51:19 607

原创 Problem 42 Coded triangle numbers(ifstream +getline)

Coded triangle numbersProblem 42The nth term of the sequence of triangle numbers is given by, tn = ½n(n+1); so the first ten triangle numbers are:1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...

2016-10-30 15:19:17 378

原创 Problem 41 Pandigital prime (暴力set+vector)

Pandigital primeProblem 41We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also pri

2016-10-30 14:38:16 410

原创 Problem 40 Champernowne's constant (暴力vector)

Champernowne's constantProblem 40An irrational decimal fraction is created by concatenating the positive integers:0.123456789101112131415161718192021...It can be seen that the 12th dig

2016-10-30 14:22:03 462

原创 Problem 39 Integer right triangles (数学)

Integer right trianglesProblem 39If p is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120.{20,48,52}, {24,45,51}

2016-10-30 01:15:53 564

原创 Problem 38 Pandigital multiples (set + vector)

Pandigital multiplesProblem 38Take the number 192 and multiply it by each of 1, 2, and 3:192 × 1 = 192192 × 2 = 384192 × 3 = 576By concatenating each product we get the 1 to 9 pand

2016-10-30 00:16:52 468

原创 Problem 37 Truncatable primes (暴力)

Truncatable primesProblem 37The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage

2016-10-30 00:14:59 613

原创 Problem 36 Double-base palindromes (二进制回文)

Double-base palindromesProblem 36The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.Find the sum of all numbers, less than one million, which are palindromic in

2016-10-30 00:13:08 662

原创 Problem 35 Circular primes (STL:rotate)

Circular primesProblem 35The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.There are thirteen such primes below 100

2016-10-30 00:11:16 566

原创 Problem 34 Digit factorials (暴力)

Digit factorialsProblem 34145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.Find the sum of all numbers which are equal to the sum of the factorial of their digits.Note: as

2016-10-29 22:08:44 405

原创 Problem 33 Digit cancelling fractions (暴力set+pair)

Digit cancelling fractionsProblem 33The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that49/98 = 4/8, which

2016-10-29 20:59:38 676

原创 Problem 32 Pandigital products (暴力+set)

Pandigital productsProblem 32We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through

2016-10-29 12:43:59 562

原创 Problem 31 Coin sums(完全背包dp)

Coin sumsProblem 31In England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation:1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p).It

2016-10-29 12:14:20 624

原创 Problem 30 Digit fifth powers (暴力枚举)

Digit fifth powersProblem 30Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:1634 = 14 + 64 + 34 + 448208 = 84 + 24 + 04 + 84

2016-10-29 11:15:14 380

原创 Problem 29 Distinct powers (set)

Distinct powersProblem 29Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:22=4, 23=8, 24=16, 25=3232=9, 33=27, 34=81, 35=24342=16, 43=64, 44=256, 45=102452=25, 5

2016-10-29 10:38:14 504 2

原创 Problem 28 Number spiral diagonals (规律题)

Number spiral diagonalsProblem 28Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:21 22 23 24 2520  7  8  9 1019  6  1

2016-10-29 02:08:13 335

原创 Problem 27 Quadratic primes (暴力枚举)

Quadratic primesProblem 27Euler discovered the remarkable quadratic formula:n2+n+41n2+n+41It turns out that the formula will produce 40 primes for the consecutive integer values 0≤n≤39

2016-10-29 01:28:24 463

原创 Problem 26 Reciprocal cycles (模拟分数除法)

Reciprocal cyclesProblem 26A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given:1/2= 0.51/3

2016-10-28 23:51:34 503

原创 Problem 25 1000-digit Fibonacci number (高精度fibonacci)

1000-digit Fibonacci numberProblem 25The Fibonacci sequence is defined by the recurrence relation:Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1.Hence the first 12 terms will be:F1 = 1F

2016-10-28 22:14:55 554

原创 Problem 24 Lexicographic permutations (全排列)

Lexicographic permutationsProblem 24A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutation

2016-10-28 13:52:18 840 1

原创 Problem 23 Non-abundant sums (盈数)

Non-abundant sumsProblem 23A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be

2016-10-28 13:42:15 555 1

原创 Problem 22 Names scores (好烦的文本读入处理题)

Names scoresProblem 22Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order.

2016-10-27 23:45:43 445

原创 Problem 21 Amicable numbers (分解因子和)

Amicable numbersProblem 21Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).If d(a) = b and d(b) = a, where a ≠ b, then a and b are

2016-10-27 23:12:05 608

原创 快速计算分解因子和

How do you work out the sum of divisors?Imagine you wish to work out the sum of divisors of the number 72. It would not take long to list the divisors, and then find their sum: 1 + 2 + 3 + 4 + 6 +

2016-10-27 22:48:50 701

原创 Problem 20 Factorial digit sum (阶乘数和)

Problem 20n! means n × (n − 1) × ... × 3 × 2 × 1For example, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800,and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.Find the

2016-10-27 22:21:46 486

原创 Problem 19 Counting Sundays (计算星期天)

Counting SundaysProblem 19You are given the following information, but you may prefer to do some research for yourself.1 Jan 1900 was a Monday.Thirty days has September,April, June a

2016-10-27 21:55:19 573

原创 Problem 67 Maximum path sum II (dp)

Maximum path sum IIProblem 67By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.37 42 4 68 5 9

2016-10-27 14:06:55 428

原创 Problem 18 Maximum path sum I (dp)

Maximum path sum IProblem 18By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.37 42 4 68 5 9 

2016-10-27 13:49:36 422

原创 Problem 17 Number letter counts (统计字母)

Number letter countsProblem 17If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.If all the numbers

2016-10-27 13:24:07 710

原创 Problem 16 Power digit sum (高精度幂)

Power digit sumProblem 16215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.What is the sum of the digits of the number 21000?Answer:1366

2016-10-26 23:25:32 693

原创 Problem 15 Lattice paths (组合数学)

Lattice pathsProblem 15Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.How many

2016-10-26 23:02:55 1235

原创 Problem 14 Longest Collatz sequence(暴力)

Longest Collatz sequenceProblem 14The following iterative sequence is defined for the set of positive integers:n → n/2 (n is even)n → 3n + 1 (n is odd)Using the rule above and starti

2016-10-26 22:30:19 944

原创 Problem 13 Large sum (大数模拟)

Large sumProblem 13Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.371072875339021027987979982208375902465101357402504637693767749000971264812489

2016-10-26 22:00:22 624

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除