Project Euler Problem 233

后端 未结 3 1904
遥遥无期
遥遥无期 2021-02-08 13:53

I\'ve decided to tackle Project Euler problem 233 next but I\'m having some major problems! I\'ve done some analysis and have made some quite nice progress but I\'ve become stuc

3条回答
  •  温柔的废话
    2021-02-08 14:29

    Hint #1. Your lemma #2 is not quite right. Are you sure that's the radius?

    Hint #2. The answer is closely related to the sum of squares function, r(k, n). This gives the number of ways to represent n using k different squares, allowing zeroes and distinguishing between order. For example, r(2, 5) is 8, because there are 8 ways to represent 5 using 2 squares:

    (-2)^2 + (-1)^2
    (-2)^2 + 1^2
    2^2    + (-1)^2
    2^2    + 1^2
    ... (and the 4 additional expressions produced by reversing these 2 terms)
    

    You can see that a circle of radius p centered at the origin has r(2, p^2) lattice points. For example, a circle with radius 5 has:

    (-4)^2 + (-3)^2
    ... and 7 others like this
    
    5^2    + 0^2
    (-5)^2 + 0^2
    0^2    + 5^2
    0^2    + (-5)^2
    

    for a total of 12. What sorts of numbers would have 420 circle lattice points? Now what if they weren't centered at the origin? I'll let you take it from here.

    If you want a much much bigger hint, I've rot-13'd (http://rot13.com) something you should check out here:

    uggc://zngujbeyq.jbysenz.pbz/FpuvamryfGurberz.ugzy

提交回复
热议问题