Lets wait for 2016

1 2014 + 2 2014 + 3 2014 + . . . + 201 4 2014 ( m o d 2016 ) \large 1^{2014}+2^{2014}+3^{2014}+...+2014^{2014} \pmod{2016}


The answer is 335.

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.

4 solutions

Brock Brown
Feb 27, 2015

Python:

1
2
3
4
total = 0
for n in xrange(1,2015):
    total += n**2014
print "Answer:", total % 2016

Alex Li
Mar 9, 2015
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
public class x
{
    public static int power2014(int x)
    {
        int z = 1;
        for(int i = 0; i<2014; i++)
        {
            z = (z*x)%2016;
        }
        return z;
    }
    public static void main(String[] args) throws IOException
    {
        int total = 0;
        for(int i = 1; i<2015; i++)
        {
            total += power2014(i);
        }
        System.out.println(total%2016);
    }
}

Kunal Verma
May 7, 2016

C++:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
using namespace std;
int modexp(int a, int b, int n)
{
    int prod=1;
    for(int i=1;i<=b;i++)
    {
        prod*=a;
        prod=prod%n;
    }
    return prod;
}
int main()
{
    long sum=0;
    for(int i=1;i<=2014;i++)
        sum+=modexp(i,2014,2016);
    cout << sum%2016;
    return 0;
}

Answer computes in 0.078s.

Nguyen Thanh Long
Jan 20, 2015

int find remainder 5() { int iK = 0, tmp = 1; List<int> ar = new List<int>(); for (int i = 1; i <= 2014; i++) { tmp = i; for (int j = 1; j < 2014; j++) { tmp = (tmp * i) % 2016; } iK = (iK + tmp) % 2016; } return iK; }

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...