Questions tagged [number-theory]

Questions on the number-theoretic functionality of Mathematica.

Filter by
Sorted by
Tagged with
1
vote
0answers
28 views

Dirichlet L-function associated to Kronecker symbol

The Fourier coefficients of the genus 2 Eisenstein series on the Siegel upper half-space are given by sums over Cohen functions. The Cohen function contains as a multiplicative factor a Dirichlet L-...
1
vote
1answer
31 views

Where To Start; Numbered Triangle

I am working on a square matrix. Cell (1,1) starts at 1, and each following 2, then 3, .., working x to y order. Plus, each cell is computed after this, to Sum of Squares minus Sum of each cell. Sorry,...
3
votes
0answers
56 views

PowerModList anomaly

This post is related to Not comprehending PowerMod. Here the issue is that PowerModList, in v. 12.1 finds no cube roots of 1 Mod 10^60 - 1: ...
2
votes
1answer
58 views

Euler Numbers A000295 And Basic MMA Code

When I run this snippet in MMA ...
0
votes
0answers
38 views

Arrange the output by 3-adic valuation

I have a number that has the form $x=\sum_{k=1}^n c_k3^{q_k}$, where $q_k\in\mathbb{Q}$ and $0\neq c_k$ is in $\mathbb{Z}$ or $i\mathbb{Z}$. We may define the $3$-adic valuation of $c_k3^{q_k}$ as $...
3
votes
1answer
57 views

Math related program

Hi I am wondering for a program that can check when the sums of divisors of an odd square number will be equal to the sums of divisors of powers of 2. So when does $$\sigma(n^2)=\sigma(2^k)$$
0
votes
0answers
61 views

Numerical comparison of two integrals and a function :

Consider the following integral: $$S(q)=\int_{x=2}^q\sin^2\left(\frac{π\Gamma(x)}{2x}\right)dx$$ And consider the functions : $$R(q)=\frac{q}{\log(q)}$$ $$T(q)=\int_2^q\frac{1}{\log(x)}dx$$ I ...
4
votes
1answer
119 views

Consider all numbers, from two-digit up to 10-digit, written only with digits 1, 2, 3, 5, 7. Identify those that are perfect squares

Consider all numbers, from two-digit up to 10-digit, written only with digits 1, 2, 3, 5, 7. Identify those that are perfect squares I got this problem but don't know how to solve it. This is what I ...
0
votes
2answers
74 views

Solving a system of equations using the data generated by PowersRepresentations and ParallelTable

First of all, it is possible to check the code that I am asking for because I know that $x=3051$ must yield at least a solution to the problem. Well, I have the following system of equations: Now, I ...
4
votes
4answers
500 views

Fibonacci sequence questions

I want to show that "Out of the first 450 Fibonacci numbers, the odd number is twice as many as even number." with Mathematica. Can you solve it please?
3
votes
1answer
78 views

Does AsymptoticSum work with Arithmetical Number Theoretic Functions?

The recent function AsymptoticSum works as follows: AsymptoticSum[1/k, {k, 1, n}, n -> \[Infinity]] with expected result: ...
1
vote
3answers
85 views

How to find a number that multiplied to a list, returns an all-integer list

I do not know how to code the following. Suppose you have a list lst={x1,...,xn}and you need to find a number $Z$, to a given digits precision such that ...
0
votes
1answer
40 views

Problem with Real Digits and and getting the sum of digits [closed]

I want to find the sum of the digits of the first 30 000 multiples of 31. I started by first finding the multiples. Like this: ...
0
votes
1answer
102 views

Sampling two integer lists of given sizes from a distribution that have equal sums

(This question emerged from discussions in this post.) Context and code sample: I am trying to figure out if there is a way to generate two $a$ and $b,$ comprised of $n_a$ and $n_b$ integers which ...
1
vote
1answer
49 views

Calculating a sum indexed by $t|gcd(m,n)$

I would like to know how to implement the sum $$f(m,n)=\frac{1}{n}\left(\sum_{t|gcd(m,n)}{\frac{m}{t}+\frac{n}{t}-1 \choose \frac{m}{t}}\phi(t)\right)$$ for two given positive entires $m, n$. Here, $\...
5
votes
3answers
142 views

Among the first 10,000 multiples of 17

Hello I'm new with Mathematica and I can't find a way where I can do this condition. Among the first 10,000 multiples of 17 how many have the sum of their digit multiple of 17? The part for the ...
4
votes
1answer
52 views

Condition for an integer exactly three primes factors? [closed]

I would like to count the number of integers n in the range [1, 10000] that satisfy all three of the properties below: n has ...
2
votes
1answer
78 views

Help: Obtain a huge amount of data solved in FrobeniusSolve? (perhaps better without running FrobeniusSolve?) [closed]

How to obtain a huge amount of data solved in FrobeniusSolve more systematically? I am interested in obtaining these two sets of data from FrobeniusSolve: ...
1
vote
1answer
69 views

Problem with Solve and PrimeZetaP

I assume this is something to do with limits on numerical precision, but can someone explain the difference in output between these two Solve problems: ...
2
votes
1answer
55 views

how to find smallest number satisfies having given number of solutions

I want to find the smallest number $t$ which satisfies $t=a^2+b^2$ ,where there are 12 pairs of $a$ and $b$ solution. my first code is very slow ...
3
votes
3answers
132 views

Is there a way to speed up the following calculation Table[If[TrueQ[],k,Nothing],{k,10^5,10^7}]

I've the following code: Table[If[TrueQ[2+3^k>2^k+(-1+2^k)*Floor[(3/2)^k]],k,Nothing],{k,10^5,10^7}] Is there a way to speed the calculation up in Mathematica ...
1
vote
0answers
65 views

Solutions given by WolframAlpha [closed]

When I try to solve, the following equation over the integers using WolframAlpha: $$x^2(1+x)=y(3y-1)\tag1$$ WolframAlpha gives me the following solutions $(x,y)$: $$(-1,0),(0,0),(1,1),(4,-5),(6,-9)\...
1
vote
1answer
61 views

Using more than 6 kernels in ParallelTable function [duplicate]

I have the following code: ParallelTable[ If[IntegerQ@Sqrt[80892036 + 17994 x (1 + x) (-5995 + 5998 x)], x, Nothing], {x, 6694300, 31072325}] It uses 6 ...
3
votes
2answers
149 views

Solve equation in number theory

Let a belongs to the set Q\ S= { -1, 0, 1}. How do solve the equation below over S? x*a^(1/x) + a^x/x == 2a
2
votes
1answer
66 views

Using Parallelize in a solve function

Is there a way to use Parallelize the following operation, in order to make it do the calculations faster? Or is there another way to speed up this calculation? ...
3
votes
2answers
127 views

Using the solve function for big numbers, getting a failure now

When I try to solve: Solve[y^2==441+48*x*(1+x)(-13+16*x)&&1100*10^9<=y<=1200*10^9&&x>=2,{y,x},Integers] My code runs for 169 seconds and ...
6
votes
3answers
183 views

Calculating the integral points of an elliptic curve

I asked this question on Math stachexchange. The question I have is: Can I use Mathematica to find the (integral points on the following elliptic curve) or can I find when the number $\text{n}$ is a ...
5
votes
0answers
57 views

How Prime[n] is implemented and why is that bounded? [duplicate]

How is Prime[n] implemented in Mathematica? I have just observed that calculating large primes is quite fast (but not in O(1) ...
0
votes
0answers
108 views

Identifying repeating patterns in a list of numbers

I have some generated lists of natural numbers which have a small number of distinct values, ie. referencing the variable "rowToCheck" for each list: list1: rowToCheck = 3: length=7, distinctvalues=3 ...
1
vote
1answer
62 views

Is there a function or a way of getting a remainder or modulus with equations with “surds”?

So I'm working with "surds", or radicals. I have expressions like $$7 + 5\sqrt{2} + 6\sqrt{3} + 7\sqrt{6}\tag{1}$$ and I want to take the "coefficients", for lack of a better word, and take their ...
1
vote
1answer
72 views

Finding the maximal number of lists that form certain rules?

I have the following example: data={1, 2, 3, 4, 5, 6, 7, 8, 9}; NN=Length[data]/3; subdata=Subsets[data, {3}]; I want to know all the possibility for the ...
4
votes
2answers
404 views

Drawing a sequence of circles

For every natural number from 1 to 150, draw a circle centered on the x-axis in that number and with the diameter equal to the number of divisors of the number. I don't know what should I do.
3
votes
2answers
199 views

solve for two variables for each n related to Collatz conjecture

For this code, for each x I would like to solve for all value ranges for c1 and c2 in a bounded range ie c1 and c2 in the range of real numbers +-100 for c1 and c2 for each x, which combined give "...
-1
votes
1answer
178 views

automatic formula finding function [duplicate]

I am curious how easy it would be to automatically find some formulas related to basic number theory OEIS sequences using some Mathematica search algorithm for a small set of OEIS sequences as a ...
2
votes
1answer
57 views

Prime factorization related functions: prime factor to its power and power of prime [duplicate]

FactorInteger can be used to perform prime factorization: FactorInteger[5^2 7^3 11^4] Results in: ...
6
votes
1answer
51 views

Abelianness-forcing number Q

In the theory of finite abstract group, abelianness-forcing number $n$ is characterized as a positive integer with standard factorization $n=p_1^{k_1}p_2^{k_2}\cdots p_r^{k_r}$ with $k_i \le 2$ and $...
11
votes
1answer
228 views

How to calculate $\prod\limits_{p}\frac{p^2+1}{p^2-1}$?

When I input $$ \prod _{p=2}^{\infty } \text{If}\left[\text{PrimeQ}[p],\frac{p^2+1}{p^2-1},1\right] $$ in Mathematica 12.0, it gives out the value $1$. The result is ridiculous, for that according to ...
5
votes
1answer
88 views

FindEquationalProof to prove divisor theorem

I'm trying to implement proofs of concepts for Equational Proofs on some basic number theory theorems. One such example is: "let a and b be positive integers and let d = gcd (a, b). If t divides ...
3
votes
1answer
128 views

Number theory in Mathematica

Is there any book out there similar to S. Wagon's Mathematica in Action that has problems/exercises/projects in the field of number theory as done in Mathematica? If not pure number theory, at least ...
0
votes
2answers
211 views

Request code for creating sequences [closed]

I would like to have Mathematica code for creating the following sequence shown as rows: ...
0
votes
1answer
56 views

Recurrence involving a product of recurrents

I can solve the following recurrence problem as follows: ...
1
vote
1answer
54 views

Expanding integer compositions

Quick version: I would like Mathematica code that, for instance, turns {3,1,2} into {3,3,3,1,2,2}. More formally, given positive integers $c_1, \ldots, c_t$ which sum to $n$, produce the length $n$ ...
0
votes
5answers
120 views

Sum Over Solutions to an Equation

Two Related Questions Is there any general built-in functionality for computing a sum over solutions to an equation? This is common in number theory. For example, computing sums of the following form....
9
votes
6answers
742 views

How can I plot a Farey diagram?

How can I plot the following diagram for a Farey series?
0
votes
1answer
39 views

Reverse the reccurence mirrorwise

Let be a recurrence for polynomials $R_{m,j}$ ...
2
votes
2answers
137 views

Displaying the number of repeating digits in a fraction

I would like to check how many repeating digits are in a large fraction, I manually did it for the first few, but the repeating length is too large to manually check. ...
0
votes
2answers
53 views

Running a loop to check for multiple congruences

I have the code for a loop to run. Right now it can check if a number is a square and at the same time check if it is congruent 0 mod 47. My questions is, how can I alter the code to see if it is ...
2
votes
1answer
173 views

Rewrite the power sum in terms of convolution

Let be an identity $$n^{2m+1}=\sum_{r=0}^{m}A_{m,r}\sum_{k=0}^{n-1}k^r(n-k)^r,$$ where $A_{m,r}$ are real coefficients, see A302971 for numerators and formula of $A_{m,r}$. Here we can notice that $\...
4
votes
1answer
878 views

Why does Solve lock up when trying to solve the quadratic equation with large integers?

Why does Solve lock up when trying to solve the equation ...
0
votes
0answers
64 views

Most efficient way to define evil and odious numbers [duplicate]

A positive integer $n$ is defined to be evil if the number of ones in its binary expansion is even, otherwise it is odious. Now define the function $$ \begin{equation*} t(n)= \begin{cases} 1 \rm{ \...

1
2 3 4 5
7