## Problem 699, error in provided example?

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you
are requested to be thoughtful in not posting anything
that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one

Don't post any spoilers
sOvr9000
Posts: 1
Joined: Sun Feb 02, 2020 7:27 pm

### Problem 699, error in provided example?

It is possible that I'm wrong, but I think there's an error in an example given in Problem 699. The example in question is T(100)=270.
The sigma function example is good, and a naive implementation of summing the factors of a positive integer will show that σ(10)=1+2+5+10=18.
The naive implementation to which I am referring is one where the square root (if it is an integer) of n is added twice. This incorrect implementation allows T(100)=270, but correcting the function to only count the square root once (if the square root is an integer) makes T(100)=258.
I specifically tested my factorization of 100, and when I was getting T(100)=270, I was counting the factor 10 twice. When I changed sigma to only count the square root once for general n, I got T(100)=258.
Am I just missing an important detail, or is my assumption correct that the square root should only be counted once?

EDIT: I also tested T(106). I got 26089275 instead of 26089287 using what I think is the correct sigma function, based on the definition given in the problem.

hk
Posts: 10706
Joined: Sun Mar 26, 2006 9:34 am
Location: Haren, Netherlands

### Re: Problem 699, error in provided example?

No, the given example is correct.
The triffle numbers not exceeding 100 are:

Code: Select all

n	sigma	sigma(n)/n
3	4      4/3
9  	13	13/9
12 	28	7/3
27	40	40/27
54	120	20/9
81	121	121/81
84	224	8/3

The answer for 10^6 is also correct.
There must be another error in your program.
(it is correct that the divisor 10 of 100 should only be added once.)