OFFSET
1,3
COMMENTS
Technically, the formula is undefined modulo 2# or 3#, but their values are listed as "0", since there are no 6's in the first differences of their reduced residue systems. For our purposes, by "6's", we mean n such that n,n+6 are relatively prime to the primorial modulus, while n+1,n+2,n+3,n+4,n+5 all share a factor (or factors) with p#. The values of this sequence are tied to actual distribution of sexy primes over N (conjecture).
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) = 2*product(p-2)-2*product(p-3), where p runs over the primes greater than 3.
EXAMPLE
Modulo 5# (=30), there are (2*(5-2)-2*(5-3))=2 occurrences where n,n+6 are relatively prime, but n+1,n+2,n+3,n+4,n+5 share a factor with 30; they are n=1,n=23(mod30). Modulo 7# (=210), there are (2*(7-2)*(5-2)-2*(7-3)*(5-3))=30-16=14 such occurrences.
MATHEMATICA
Table[2 Product[Prime@ k - 2, {k, 3, n}] - 2 Product[Prime@ k - 3, {k, 3, n}], {n, 21}] (* Michael De Vlieger, Apr 11 2016 *)
PROG
(PARI) a(n) = 2*prod(k=3, n, prime(k)-2) - 2*prod(k=3, n, prime(k)-3); \\ Michel Marcus, Apr 10 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Logan W. Wilbur, Apr 09 2016
EXTENSIONS
Corrected and extended by Michel Marcus, Apr 10 2016
STATUS
approved