All the buzzkill for just one number

I have a 10 10 digit number in mind, you can obtain the digits of the number from left to right by following the five points below.

\bullet The 3 rd 3^{\text{rd}} smallest positive integer which has square root of the sum of all its quadratic residues equal to 1 3 \frac{1}{3} of the integer itself, gives first 2 2 digits of my number.

\bullet If 489 489 people are sitting around a table, everyone given numbers 1 1 to 489 489 clockwise (counting starts from number 1 1 ) and then every 1 3 th 13^{\text{th}} person is asked to get out. The only remaining person's number gives next 3 3 digits of my number. In other words, find josephus ( 489 , 13 ) \text{josephus}(489,13) .

\bullet The 7 th 7^{\text{th}} largest positive integer which has, out of all positive integers less than itself, exactly 60 60 coprime to itself, gives next 2 2 digits of my number. In other words, find the seventh largest n n such that phi ( n ) = 60 \text{phi}(n)=60

\bullet The only prime number which has exactly 27 27 quadratic residues gives next 2 2 digits of my number

\bullet The last digit of my number is 0 0


What is my number?


Details and assumptions :

\bigotimes This problem May seem boring because it's long, but will feel awesome after solving. Everything in this problem has a meaning, nothing is a troll.

\bigotimes Quadratic residues of a number n n are the possible remainders when square of any integer is divided by n n .

For example, any square integer can give remainder only from ( 0 , 1 , 4 , 5 , 6 , 9 ) (0,1,4,5,6,9) when divided by 10 10 , so 10 10 has six quadratic residues and their sum is 0 + 1 + 4 + 5 + 6 + 9 = 25 0+1+4+5+6+9=25

\bigotimes Here are links, if you want clarification regarding concepts used in the problem.


Concept of many problems in one, adapted from Pi Han Goh's Buzzkill


The answer is 9922793530.

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.

3 solutions

Aditya Raut
Mar 23, 2015

Here are python programs for things i used in this problem-

Josephus problem (Returns a number)

1
2
3
4
5
6
7
def josephus(n, r):
    t = 0
    i = 1
    while i <= n:
        t = (t + r) % i
        i += 1
    return t + 1

Euler's Totient Function , or phi ϕ \phi (Returns a number)

1
2
3
4
5
6
7
from fractions import gcd
def phi(n):
    list=[]
    for i in range(n):
        if gcd(n,i)==1:
            list.append(i)
    return len(list)

Quadratic Residues (Returns list of quadratic residues)

1
2
3
4
5
6
7
def quad_residue(n):
    li=[]
    for i in range(n):
        li.append(i*i%n)
    b=set(li)
    li=list(b)
    return li

Prime numbers (Returns list of prime numbers till 'a')

1
2
3
4
5
6
def primes(n):
     list=[]
     for  a in range(n):
               if not ( a < 2 or any(a % i == 0 for i in range(2, int(a ** 0.5) + 1))) is True:
                 list.append(a)
     return list


As asked in the problem, here's point by point solution of the 5 bullet point conditions.

1
2
3
4
5
6
7
8
import math
for i in range(1,100):
        if math.sqrt(sum(quad_residue(i)))==i/float(3): 
                       print i
3
45
99
>>>

Hence needed number is 99 \boxed{99}


1
2
josephus(489,13)
227

Hence next 3 digits are 227 \boxed{227}


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
for i in range(1000):
       if phi(i)==60:
           print i
61
77
93
99
122
124
154
186
198

Hence 7th largest number with phi(n)=60 is 93 \boxed{93}


1
2
3
4
for i in primes(1000):
      if len(quad_residue(i))==27:
          print i
53

Hence the next 2 digits are 53 \boxed{53} . Last digit is 0, given.

Hence the 10-digit number is 9922793530 \boxed{9922793530}

@Agnishom Chattopadhyay , @Pranjal Jain , @Raghav Vaidyanathan .... Long but interesting!

Aditya Raut - 6 years, 2 months ago

Log in to reply

Yeah it indeed is! I hope you won't mind me adding these functions to my library! ¨ \ddot\smile

Pranjal Jain - 6 years, 2 months ago

Log in to reply

Of course ! I hv a file I made, which has all the math programs I wrote or came across, ever! Want it? ( it even has descriptions of what ds the program return,.. All u gotta do is press CTRL+F5 after opening it frm python... All programs will automatically run, ready to use!
@Pranjal Jain .... btw cn u guess what this answer actually is?

Aditya Raut - 6 years, 2 months ago

Log in to reply

@Aditya Raut Hi , is this number really what I think it is ? Should I give it a try ?

A Former Brilliant Member - 6 years, 2 months ago

The 7 t h 7th largest thing made me lose a try! Of course, then I counted backwards, but how can we be sure that there are no more numbers greater than 198 198 which have totient as 60 60 ?? Nice question though. I had almost all of the codes beforehand, so it didn't take me much time.

Raghav Vaidyanathan - 6 years, 2 months ago

Log in to reply

BTW when u need emergency quick response from me, you can dial this number ;)
@Raghav Vaidyanathan

Aditya Raut - 6 years, 2 months ago

Dude as we are also 'Math' friends along with programming, I expect frm u to see that all the primes less than a number come in phi, and obviously there are more than 60 primes less than all bigger numbers ( I already checked till 1000 in the solution)

Aditya Raut - 6 years, 2 months ago

Log in to reply

@Aditya Raut All primes less than a number which do not divide the number come in phi. Consider the product of the first 60 60 prime numbers, the totient of this number depends on the number of prime numbers between the 6 0 t h 60^{th} prime number and our number. I guess it is safe to assume that there will be more than 60 60 co prime integers in this range. The proof, i guess will be trivial, but that's the thing, I suck at easy proofs. speed dial @Aditya Raut

Raghav Vaidyanathan - 6 years, 2 months ago

Log in to reply

@Raghav Vaidyanathan That number will be really very huge! My program ( primes(n) )says that the product is

24647906487115793512432470614609487044327490547070674282967249490409801198254927547005559122946385681862066942895590

you can for sure assume there are more than 600000 primes, why ask just 60 60 ?

Aditya Raut - 6 years, 2 months ago

I got this correct on my last try. I still can't understand 3rd point, why the 7th largest number is 93 rather than 154?

Edit: Aah! I get it now. Largest is the last one (e.g. 198). That's why we have to count from the last. It really is like a paradox.

MD Omur Faruque - 5 years, 8 months ago
Alex Li
Mar 23, 2015
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
import java.util.Scanner;
import java.io.File;
public class x
{
    public static int sumQuadRes(int x)
    {
        ArrayList<Integer> y = new ArrayList<Integer>();
        for(int i = 0; i <= x/2; i++) //quadratic residuals are symmetric
        {
            if(!y.contains(i*i%x))
            {
                y.add(i*i%x);
            }
        }
        int total = 0;
        for(int i = 0; i < y.size(); i++)
        {
            total += y.get(i);
        }
        return total;
    }
    public static int countQuadRes(int x)
    {
        ArrayList<Integer> y = new ArrayList<Integer>();
        for(int i = 0; i <= x/2; i++)
        {
            if(!y.contains(i*i%x))
            {
                y.add(i*i%x);
            }
        }
        return y.size();
    }
    public static boolean isRelativelyPrime(int a, int b)
    {
        for(int i = 2; i <= a; i++)
        {
            if(a%i == 0 && b%i == 0)
            {
                return false;
            }
        }
        return true;
    }
    public static int phi(int x)
    {
        int c = 0;
        for(int i = 1; i <= x; i++)
        {
            if(isRelativelyPrime(i, x))
            {
                c++;
            }
        }
        return c;
    }
    public static void main(String[] args) throws IOException
    {
        //part 1
        for(int i = 1; i < 100; i++)
        {
            if(Math.sqrt(sumQuadRes(i)) == i/3.0)
            {
                System.out.println(i);
            }
        }
        //result is 99

        //part 2
        ArrayList<Integer> n = new ArrayList<Integer>();
        int person = 0;
        int count2 = 0;
        while(n.size() < 488)
        {
            person++;
            if(person == 490)
            {
                person = 1;
            }
            if(!n.contains(person))
            {
                count2++;
                if(count2 == 13)
                {
                    n.add(person);
                    count2 = 0;
                }
            }
        }
        for(Integer i = 1; i<490; i++)
        {
            if(!n.contains(i))
            {
                System.out.println(i);
            }
        }
        //result is 227

        //part 3
        for(int i = 60; i <= 2310; i++) //2310 = 2*3*5*7*11, phi(n) >= 1*2*4*6*10=480 for n > 2310
        {
            if(phi(i) == 60)
            {
                System.out.println(i);
            }
        }
        //result is 93

        //part 4
        for(int i = 10; i < 100; i++)
        {
            if(countQuadRes(i) == 27)
            {
                System.out.println(i);
            }
        }
        //prints 53 and 85, of which 53 is prime
        //final answer: 9922793530. Phew!   
    }
}

I understand that to get the numbering you need to add "tick" marks but how do you add those ? I'm not able to do so , can you help me ?

A Former Brilliant Member - 6 years, 2 months ago

Log in to reply

Type 3 tick marks followed immediately by "java" at the beginning of the code, and 3 tick marks at the end. The key for tick marks is at the upper left of standard keyboards.

Alex Li - 6 years, 2 months ago

Log in to reply

Thanks :) +1

A Former Brilliant Member - 6 years, 2 months ago
Masbahul Islam
Aug 22, 2016

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...