number-theory
Representing an integer as the sum of four squares
Given a positive integer m,find four integers a, b, c, 开发者_开发百科d such that a^2 + b^2 + c^2 + d^2 = m in O(m^2 log m). Extra space can be used.[详细]
2023-04-08 04:35 分类:问答How to return more than one value from a C++ function?
I am interested if I can return more then one value from a function. For example consider such a function: extended euclidean algorithm. The basic step is described by this[详细]
2023-04-03 09:49 分类:问答How to find total number of divisors upto N?
Given a number N, have to find number the divisors for all i where i>=1 and i<=N. Can\'t figure it out.Do I 开发者_运维百科have to this using prime factorization? Limit is N<=10^9[详细]
2023-04-03 05:26 分类:问答<Algorithms >Divisor Problem
Given a the number of divisors, we have to find the first triangle number. A triangle number is same as sum of natural numbers.[详细]
2023-03-06 23:41 分类:问答What is an elegant way to find all prime numbers in a specified range in R? [duplicate]
This question already has answers here: Closed 11 years ago. Possible Duplicate: Generate a list of primes in R up to a certain number[详细]
2023-03-02 03:02 分类:问答Speed up calculation of partitions in Haskell
I\'m trying to solve Euler problem 78, which basically asks for the first number where the partition function p(n) is divisible by 1000000.开发者_如何学Go[详细]
2023-03-01 02:08 分类:问答Group theory within Cryptography regarding order of elements in a group of integers Z*p
I was kinda thrown in the deep end into group theory and i am a bit lost for a Cryptography class i have.[详细]
2023-02-28 16:07 分类:问答Generate very very large random numbers
How would you generate a very very large random number? I am thinking on the order of 2^10^9 (one billion bits). Any programming language -- I assume the solution would translate to other languages.[详细]
2023-02-19 20:26 分类:问答What's the fastest algorithm to represent a prime as sum of two squares?
I could use two loops to check for all combinations of two integers that less than p prime, but it\'s 开发者_开发知识库very inefficient. Is there a better algorithm to approach this problem? Any idea?[详细]
2023-02-18 22:32 分类:问答Getting a list of square-free numbers
One way to get that is for the natu开发者_如何学Goral numbers (1,..,n) we factorise each and see if they have any repeated prime factors, but that would take a lot of time for large n. So is there any[详细]
2023-02-16 19:14 分类:问答