OFFSET
1,4
COMMENTS
Technically, the formula is undefined modulo 2# or 3#, but I have listed their values as "0", since there are no 10's in the first differences of their reduced residue systems. For our purposes, by "10's", we mean n such that n,n+10 are relatively prime to the primorial modulus, while n+1,n+2,n+3,n+4,n+5,n+6,n+7,n+8,n+9 all share a factor (or factors) with p#.
LINKS
Steven Brown, Distance between consecutive elements of the multiplicative group of integers modulo n, arXiv:2311.06873 [math.NT], 2023. See Table 1 p. 25.
FORMULA
a(n) = 4*product(p-2) - 6*product(p-3) + 2*product(p-4), where p runs through the primes > 5 and <= prime(n).
MATHEMATICA
Table[4*Product[-2 + Prime[z], {z, 4, i}] -
6*Product[-3 + Prime[z], {z, 4, i}] +
2*Product[-4 + Prime[z], {z, 4, i}], {i, 20}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Andrew Fuchs, Apr 16 2017
STATUS
approved