Modified Euler's Totient function for counting constellations in reduced residue systems

Solution 1:

1: Your formula for $\phi(-k)(n)$ does count the number of reduced residues $a$, modulo the product of the first $n$ primes except for those primes less than or equal to $k$, for which $a+1, \dots, a+k-1$ are all reduced residues. It's a rather specialized situation.

2: For a similar formula that counts $k$-tuples of reduced residues more generally, look at the Prime $k$-tuples Conjecture, particularly the infinite product of primes that appears as a constant in it.

Solution 2:

I am interested in this topic too, primarily prime sieve mathematics, which happens to tie itself up in reduced residue sets and all kind of other number theoretic topics.

To start off, lets look at the dRRS function on primorials, that is: the differences of a reduced residue system modulo primorials. The dRRS function would basically give us the gap sequence to hit numbers CoPrime to a primorial. It would enable us to get future primes, when folded by addition from 1.

For example, dRRS[Primorial1] is just {2}, if we start from 1 and continue adding 2, we will hit only odd numbers. Effectively, 2 eliminates half of all natural numbers from being prime.

dRRS[Primorial[2]] is {4,2} and allows us to skip any multiplies of BOTH 2 and 3, when folded from 1 by addition. That is, we would go from

$1\to5\to7\to11\to13\to17\to19\to23\to25$, etc.. Notice how we hit 25, that is 5 squared. This is very relevant. The dRRS function will allow us to get actual primes but only until the next prime squared.

Lets move to how each dRRS result transforms into the next.

For reference:

dRRS[Primorial1] = {2}

To get the dRRS result for the next primorial, we make (next prime = 3) many copies. {2},{2},{2}

Now we add the first two terms. And we get {4,2}

dRRS[Primorial[2]] = {4,2}

Easy huh? Well it doesn't remain this easy. Okay, we are going to repeat the same procedure. Lets make (next prime=5) many copies. {4,2}{4,2}{4,2}{4,2}{4,2}

Now we will multiply {4,2} by 5 as well. We get {20,10} For every sum of 20,10 repeated, we will mark as a set. We do not count the first number though when we are summing, that remains in its own set.

We get {{4}, {2, 4, 2, 4, 2, 4, 2}, {4, 2}}

Now we add neighboring numbers from each set. And we get:

dRRS[Primorial[3]] = {6,4,2,4,2,4,6,2}

The reason I show this procedure even though you might be familiar with the reduced residue sets of primorials, is because this directly shows where the chaos of primes inherently comes from. From partitioning, and copying. Recursively.

Okay, well anyhow, I thought you might want to know that each population has a distinct closed formula equal to sums of products of offset primes. I have not figured out a generic way to generate these, I have only brute-forced them using Mathematica at the moment. But that is what I am looking at next in my search for truth.

Firstly, there are never any consecutive twins, quads, hextuplets, etc, etc ie. the count of {2,2} or {4,4} or {6,6} etc constellations, is always 0, for any dRRS of primorials.

2's and 4's have a count equal to Product[Prime[z] - 2, {z, 2, i}] ( you already know this )

All tuplets have the same count as their palindrome. That is, {2,4} and {4,2} will have equal counts. This is because the dRRS is palindromic itself

Illustrations: ListPlots of dRRS[Primorial[4]], dRRS[Primorial[5]]

the count of {2,4}s is Product[Prime[z] - 3, {z, 3, i}] the count of 6s is 2*Product[Prime[z] - 2, {z, 2, i}] - 2*Product[Prime[z] - 3, {z, 3, i}]

It is clear, because of the partitioning and copying we discussed earlier, that the count of 6s can be derived from the count of constellations {2,4},{4,2}, 2s, and 4s. And so there is clearly a recursive formula that should be able to be derived for the count of any arbitrary constellation.

Again, here are the formulas I currently have, tested up to dRRS[Primorial[10]]


    2 =>   Product[Prime[z] - 2, {z, 2, i}]
    4 =>   Product[Prime[z] - 2, {z, 2, i}]
{2,4} =>   Product[Prime[z] - 3, {z, 3, i}]
{4,2} =>   Product[Prime[z] - 3, {z, 3, i}]
    6 => 2*Product[Prime[z] - 2, {z, 2, i}] - 2*Product[Prime[z] - 3, {z, 3, i}]
{2,6} =>   Product[Prime[z] - 3, {z, 3, i}] +   Product[Prime[z] - 4, {z, 2, i}]
{6,2} =>   Product[Prime[z] - 3, {z, 3, i}] +   Product[Prime[z] - 4, {z, 2, i}]
    8 =>   Product[Prime[z] - 2, {z, 2, i}] - 2*Product[Prime[z] - 3, {z, 3, i}] - Product[Prime[z] - 4, {z, 2, i}]

Another interest fact that I don't know if you are aware of, is that Max[dRRS[Primorial[i]]] is the Jacobsthalian Function of Primorials, seen here: http://oeis.org/A048670

I hope if you are still interested in this topic (which clearly related to the Riemann Hypothesis) that we can maybe put our heads together. Cheers.