Divisor Mods

Denote S ( n ) S(n) the sum of all the positive divisors of n n , including itself. For example: S ( 12 ) = 1 + 2 + 3 + 4 + 6 + 12 = 28 S(12)=1+2+3+4+6+12=28 .

Find the smallest positive integer n > 10 n>10 such that

S ( n ) 2018 ( m o d n ) . S(n) \equiv2018 \pmod n.


The answer is 26.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Zeeshan Ali
May 12, 2018
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
def S(n):
    '''
    INPUT:
        n: natual number
    OUTPUT:
        Sum: sum of all the complete-devisors of 'n'
    '''
    Sum = n
    for i in range(1, n//2+1):
        if n%i == 0:
            Sum += i
    return Sum

# Find the smallest natual number such that S(n) = 2018 (mod n)
for n in range(1, 9999):
    if S(n)%n == 2018:
        print ("S(", n ,") =", S(n), '=', 2018, "(mod", n, ')')
        break

S( 26) = 42 = 2018 (mod 26)

nice
here is a Mathematica code

n=1;While[Mod[DivisorSigma[1,n],n++]!=2018];n-1

Giorgos K. - 3 years ago

Isn't the statement true for n = 26 n=26 ? The number of divisors is 1 + 2 + 13 + 26 = 42 1+2+13+26=42 . But 42 16 ( m o d 26 ) 42\equiv16 \pmod{26} and 2018 16 ( m o d 26 ) 2018\equiv16 \pmod{26} . Does the residue class need to be specified by the lowest positive element? My condition ignoring this fact is just the following:

1
if (sumdiv(n) % n) == (2018 % n):

Poca Poca - 3 years ago

Log in to reply

I agree with you.

Ricardo Moritz Cavalcanti - 3 months, 2 weeks ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...