Questions tagged [number-theory]

Questions on the number-theoretic functionality of Mathematica.

Filter by
Sorted by
Tagged with
2
votes
1answer
80 views

Mathematica code for q-Stirling numbers

In the paper [A new $q$-Analog of Stirling Numbers],(https://hal.archives-ouvertes.fr/hal-01372920/document)[PDF] J. Cigler defined $q$-Stirling numbers of the second kind as the following: He ...
0
votes
1answer
51 views

Check if a fraction leads to an integer, choose $r$ and run trough $0\le a\le n$ and go to $r+1$

Well, I am trying to do the following: I have two functions $y(r,a)$ and $z(r,a)$ and I want to check of the division of both those functions leads to an integer. In order to do that I want to choose ...
2
votes
2answers
106 views

Finding IntegerPartitions[252] with no zero and no duplicates

Well, I am trying to execute the following code: ...
0
votes
0answers
43 views

Alternative for PowerRepresentations[n, x, 1]

I am looking for numbers $n$ that can be written as the sum of other numbers. So: PowersRepresentations[n, x, 1]. But is there a faster way of finding these numbers?...
0
votes
0answers
24 views

Fourier expansion of Dedekind eta function with rational arguments

I want to be able to compute the Fourier series expansion in q=Exp[2πiz] for DedekindEta[(az+b)/(cz+d)] with integer a,b,c,d, but not requiring ad-bc=1. Just replacing z in terms of q and doing ...
4
votes
3answers
297 views

Checking if a number is right sorted

I have a number $n$ such that the digits of $n$ are strictly increasing to the left except for the first digit. So for example when $n=51369$ fits the bill because: $$1<3<6<9\tag1$$ Is there ...
2
votes
1answer
120 views

Calculate the Leyland number index of a given Leyland (x,y) pair

A Leyland number L(x,y) is x^y + y^x where x>=y>1. OEIS A076980 prepends L(2,1) as its first term. The first ten Leyland number (x,y) pairs ordered by magnitude are (2,1), (2,2), (3,2), (4,2), (...
5
votes
1answer
314 views

Sum a number's digits until only one digit remain

I want to iteratively calculate the sum of a number's digits, until the result contains only one digit. For example, when $n=67946$ we get: $$6+7+9+4+6=32\space\to\space3+2=5\tag1$$ So, when $n=67946$ ...
2
votes
0answers
90 views

Finding the sum of the product of factorials of the digits of numbers

I want to calculate the sum of the product of factorials of the digits of numbers. So for example, when $n=467$ I get: $$n=467\space\to\space\left(4!\right)\cdot\left(6!\right)\cdot\left(7!\right)=...
5
votes
8answers
1k views

Making the number 12345...n

Well, I am trying to write a code that makes the number: $$123456\dots n\tag1$$ So, when $n=10$ we get: $$12345678910$$ And when $n=15$ we get: $$123456789101112131415$$ And when $n=4$ we get: $$1234$$...
0
votes
1answer
68 views

Parallelization in While[] loop when testing if a condition is met

Well, I am trying to run the following code: ...
1
vote
0answers
60 views

Implementing the Binary GCD algorithm in Mathematica

Well, I have $n\in\mathbb{N}$ and I want to transform $n$ to a binary number which can be done using FromDigits[IntegerDigits[n, 2]]. I want to compute the ...
0
votes
0answers
32 views

Making a binary number $n$ that must contain $k$ times a $1$ such that `k==GCD[n,IntegerReverse[n]]`

Well, I am trying to code the following thing in Mathematica: I have a binary number $n$ that must contain $k$ times a $1$. So for example: when $k=5$ the following binary numbers does fit the rule: $$...
0
votes
1answer
154 views

Computing an infinite sum

I wish to compute $$\sum_{n=1}^{\infty} f(n)e^{-nz}$$ where $f(n)= |\{(a,b,c)| abc=n\}|$ and $z>0$. Its easy to compute that if $n = \prod p_{i}^{\alpha_i}$ where $p_i$ are distinct primes then $$f(...
1
vote
1answer
70 views

Solving a system of equations using a list of possible solutions

Well, I have for example the following input and output of a code: ...
-1
votes
1answer
89 views

Create Predicate Function like PrimeQ :: fibonacciQ, pythgoreanQ

Yes, just define the function. i.e. Use the Fibonacci numbers. What are good practices to perform it? (Vague, let's get specific.) Create list of Fib.s 0, to 1,000,000. Make function _Integer ...
1
vote
1answer
74 views

Parallel Mathematica-code that runs too slow when running PowerRepresentations[] function

Well, I am a student in elementary number theory and trying to find natural numbers that can be written as the sum of integers to the power of an integer. The code I am using now is the following: <...
0
votes
0answers
41 views

Solving a system of equations (works with squares not with fifth powers)

Well, I was trying to solve a system of equations in a different question of mine. There @kglr gave a very efficient code for solving that system of equations using squares: ...
-1
votes
1answer
58 views

Some number theory problem which I want to check via Mathematica

my Programming skills are quite horrendous (I don't work in the industry). I want to check the following problem by programming in Mathematica, so I'd appreciate if someone can chime in and help me ...
3
votes
1answer
77 views

Removing a element from list when obeying a certain condition

Well, I have the following code: Select[PowersRepresentations[n, a, b], DuplicateFreeQ[#] && ! MemberQ[#, 0] &] This code finds ...
3
votes
3answers
237 views

Solving for a unique set of solutions

I have the following code: ...
1
vote
2answers
128 views

Solve System of congruences

How can I solve a system of linear congruences as such? $$\begin{align*} 3x+2y+28z &= 9 \pmod {29} \\ 5x+27y+z &= 9 \pmod {29} \\ 2x+y+z &= 6 \pmod {29} \end{align*}$$ I tried it this ...
2
votes
1answer
73 views

How does Leafcount work? [closed]

I am curious about how LeafCount works because when I count the number of leaves in my solution to a Wolfram Challenge, I get a much smaller result than those listed on the leaderboard for Multiples ...
0
votes
1answer
46 views
0
votes
0answers
55 views

Inverse/Division in finite field?

Think of multiplictavie group of finite field F[p,n], where p is a prime number and n is a positive integer. The whole elements of F[p,n] can be represented as p^n-p^(n-1) positive integers in the ...
6
votes
3answers
488 views

Prove an inequality over the reals, given a constraint

Given $a,b,c \geq 0$ and $$a + b + c = 3$$ prove $$\frac{a}{b^2 + 1} + \frac{b}{c^2 + 1} + \frac{c}{a^2 + 1} \geq \frac{3}{2}$$ One can prove the above using a great deal of "human" insight ...
4
votes
1answer
274 views

Largest k such that p^k divides n

(Here all variables are integer.) Is there a built-in function f[n,p] such that f[n,p] = largest k such that p^k divides n For ...
2
votes
1answer
142 views

define edge set of a graph

I want to define a graph in Mathematica which its vertex set is cartesian product of two sets. I define the vertex set by Tuple[] but two vertices are adjacent if and only if the intersection of the ...
0
votes
1answer
68 views

Non trivial zeros of Dirichlet L function

So I was wondering if I can find some of the non trivial zeros of the Dirichlet-L function using mathematica. What I found out was there is a code ZetaZero[] which ...
0
votes
0answers
97 views

How to implement statistics for the length of continued fractions of a result on MATHEMATICA

After successfully generating the reduced fraction of two coprime in interval (0,1] with the following; ...
4
votes
0answers
60 views

Residue for $L(s,\chi_1)$ not same in Mathematica as theoretical value

I want to find the residue of Dirichlet-L function, defined as $L(s,\chi)= \sum_{n=1}^\infty \frac{\chi(n)}{n^s}$ for $Re(s)>1$. We know that $Res_{s=1}L(s,\chi_1)=\frac{\phi(k)}{k}$, where $\chi$ ...
0
votes
0answers
25 views

Why does explicit Dirichlet Transform of Liouville Lambda not evaluate?

I have four expressions for the Dirichlet Transform of the Liouville-Lambda function, but one form does not evaluate, any ideas why and what could be done?
5
votes
2answers
125 views

Counting zeros of list from Twin Primes calculation

...
3
votes
2answers
143 views

How to FInd the sum of odd divisor of a number in Mathematica?

So I want to find the sum of odd divisors of a number raised to some power. $i.e.$ I want to find $\sum_{n=1}^\infty\sigma'_{-2k-1}(n)$ where $\sigma'_{-2k-1}(n) = \sum_{d|n, \text{d odd}} d^{-2k-1}$. ...
0
votes
1answer
32 views

Find a solution to a congruence within a specified range

My problem is to find all the integer solutions of the following conguence: $$P=0\ \text{mod}\ 4$$ where $$p=q^2∗r^2∗y^4∗z^2∗(2∗w^4+2∗r^2∗w^4∗y^4∗z^2+r^2∗w^8∗y^4∗z^2+2) + q^2+ 2∗r^6∗w^4∗y^m∗z^6∗(w+w^2+...
1
vote
1answer
37 views

Recursive Dirichlet convolutions and sum errors

I only have an informal knowledge of mathematical at best, learned entirely from modifying premade programs, and reading the documentation of functions, so I apologize if my question should be obvious ...
0
votes
1answer
44 views

Numerical value of Derivative of Dirichlet L function at some particular points [closed]

I want to find the numerical value for the derivative of Dirichlet L function to compare with an another formula. However I am not able to obtain any numerical values. I tried to use ...
2
votes
1answer
113 views

Comparing the plots of two functions in number theory

Definition. For $x>1$, let $$R(x):=\sum_{n\ge1}\frac{\mu(n)}{n}\,\operatorname{li}(x^{1/n})$$ denote the Riemann prime counting function. If you are not familiar with the mathematical expressions ...
0
votes
1answer
117 views

Factorizing large numbers [closed]

I am trying to factorize large prime numbers with the code bellow. The code works properly for values like 1927 and 69527 (results), but gives no result for larger values like 655051. The code goes as ...
1
vote
2answers
88 views

How can I test if the sum of two divisors of a number add up to a perfect square? [closed]

Let's say I have a number $n$ and I want to find the divisors of $n$, I can do that using Divisors[n]. That will generate a list ...
11
votes
8answers
1k views

Transform a number to a factorial

I came across the need to transform a number into a factorial n, with positive integer n. I have searched in the MMA information but I can't find anything like that. I imagine an input, which verifies ...
-2
votes
1answer
36 views

Find a number from the remainders modulo two integers [closed]

If the remainder of the division of $n$ by 7 equals 5, what is the remainder of the division of $2n$ by 7?
0
votes
1answer
52 views

Random composite integer n with 200 digits and Miller-Rabin witnesses [closed]

I wanna take a random composite integer n with 200 digits and check how many, out of 100 random integers, that are Miller-Rabin witnesses for compositeness of the integer n. The first thing I need to ...
2
votes
1answer
60 views

Strange results from FrobeniusSolve

As part of pruning for my code searching for optimal addition chains I want to try and find some fast ways to discover that certain numbers are not representable in the Frobenius coin problem. An ...
3
votes
0answers
125 views

Does anyone have a Mathematica implementation of the standard $\arg\zeta(s)$ function required to evaluate $S(T)$?

This question is related to my question Is there an elegant exact formula for the zeta zero counting function? on Math StackExchange. Question: Does anyone have a Mathematica implementation of the ...
1
vote
2answers
116 views

Whats the Mathematica command for the skew harmonic number?

What's the Mathematica code for the skew harmonic number: $$\overline{H}_n=\sum_{k=1}^n \frac{(-1)^{k-1}}{k}.$$ Wolfram expresses this number as $$\ln(2)-(-1)^n \text{LerchPhi}(-1,1,n+1).$$ I am ...
2
votes
2answers
326 views

How to ask Mathematica to solve a simple modular equation

What's the most straightforward way to ask Mathematica to find all solutions of an equation like $$3x + 2y + 4z = 0 \pmod {11}$$ (for instance), where either $x$, $y$, $z$ can be considered to be ...
3
votes
1answer
155 views

Solving calculation puzzle [closed]

I recently got asked how to achieve a result of 100 only using the numbers {1,7,7,7,7} (the number 1 can be used only once and ...
1
vote
2answers
137 views

Plotting Riemann Prime Counting

I want to program the formula in this page. Didn't take me long to get to my code below. But 1) it only plots the prime counting function and 2) evaluation takes incredibly long. How can I fix it? <...
0
votes
2answers
84 views

Combining lists of a factors with multiplicity

I want to combine factorizations of integers (in the form output by FactorInteger, that is a list of factors with multiplicities) into the factorization of the ...

1
2 3 4 5
9