cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 14 results. Next

A056169 Number of unitary prime divisors of n.

Original entry on oeis.org

0, 1, 1, 0, 1, 2, 1, 0, 0, 2, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 2, 2, 1, 1, 0, 2, 0, 1, 1, 3, 1, 0, 2, 2, 2, 0, 1, 2, 2, 1, 1, 3, 1, 1, 1, 2, 1, 1, 0, 1, 2, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 0, 2, 3, 1, 1, 2, 3, 1, 0, 1, 2, 1, 1, 2, 3, 1, 1, 0, 2, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 2, 2, 2, 1, 1, 1, 1, 0, 1, 3, 1, 1, 3
Offset: 1

Views

Author

Labos Elemer, Jul 27 2000

Keywords

Comments

The zeros of this sequences are the powerful numbers (A001694). There are no arbitrarily long subsequences with a given upper bound; for example, every sequence of 4 values includes one divisible by 2 but not 4, so there are no more than 3 consecutive zeros. Similarly, there can be no more than 23 consecutive values with none divisible by both 2 and 3 but neither 4 nor 9 (so a(n) >= 2), etc. In general, this gives an upper bound that is a (relatively) small multiple of the k-th primorial number (prime(k)#). One suspects that the actual upper bounds for such subsequences are quite a bit lower; e.g., Erdős conjectured that there are no three consecutive powerful numbers. - Franklin T. Adams-Watters, Aug 08 2006
In particular, for every A048670(k)*A002110(k) consecutive terms, at least one is greater than or equal to k. - Charlie Neder, Jan 03 2019
Following Catalan's conjecture (which became Mihăilescu's theorem in 2002), the first case of two consecutive zeros in this sequence is for a(8) and a(9), because 8 = 2^3 and 9 = 3^2, and there are no other consecutive zeros for consecutive powers. However, there are other pairs of consecutive zeros at powerful numbers (A001694, A060355). The next example is a(288) = a(289) = 0, because 288 = 2^5 * 3^2 and 289 = 17^2, then also a(675) and a(676). - Bernard Schott, Jan 06 2019
a(2k-1) is the number of primes p such that p || x + y and p^2 || x^(2k-1) + y^(2k-1) for some positive integers x and y. For any positive integers x, y and k > 1, there is no prime p such that p || x + y and p^2 || x^(2k) + y^(2k). - Jinyuan Wang, Apr 08 2020

Examples

			9 = 3^2 so a(9) = 0; 10 = 2 * 5 so a(10) = 2; 11 = 11^1 so a(11) = 1.
		

Crossrefs

Programs

  • Haskell
    a056169 = length . filter (== 1) . a124010_row
    -- Reinhard Zumkeller, Sep 10 2013
    
  • Maple
    a:= n-> nops(select(i-> i[2]=1, ifactors(n)[2])):
    seq(a(n), n=1..120);  # Alois P. Heinz, Mar 27 2017
  • Mathematica
    Join[{0},Table[Count[Transpose[FactorInteger[n]][[2]],1],{n,2,110}]] (* Harvey P. Dale, Mar 15 2012 *)
    Table[DivisorSum[n, 1 &, And[PrimeQ@ #, CoprimeQ[#, n/#]] &], {n, 105}] (* Michael De Vlieger, Nov 28 2017 *)
  • PARI
    a(n)=my(f=factor(n)[,2]); sum(i=1,#f,f[i]==1) \\ Charles R Greathouse IV, Apr 29 2015
    
  • Python
    from sympy import factorint
    def a(n):
        f=factorint(n)
        return 0 if n==1 else sum(1 for i in f if f[i]==1)
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 19 2017
    
  • Scheme
    ;; With memoization-macro definec.
    (definec (A056169 n) (if (= 1 n) 0 (+ (if (= 1 (A067029 n)) 1 0) (A056169 (A028234 n))))) ;; Antti Karttunen, Nov 28 2017

Formula

A prime factor of n is unitary iff its exponent is 1 in prime factorization of n. In general, gcd(p, n/p) = 1 or = p.
Additive with a(p^e) = 1 if e = 1, 0 otherwise.
a(n) = #{k: A124010(n,k) = 1, k = 1..A001221}. - Reinhard Zumkeller, Sep 10 2013
From Antti Karttunen, Nov 28 2017: (Start)
a(1) = 0; for n > 1, a(n) = A063524(A067029(n)) + a(A028234(n)).
a(n) = A001221(A055231(n)) = A001222(A055231(n)).
a(n) = A001221(n) - A056170(n) = A001221(n) - A001221(A000188(n)).
a(n) = A001222(n) - A275812(n).
a(n) = A162642(n) - A295662(n).
a(n) <= A162642(n) <= a(n) + A295659(n).
a(n) <= A295664(n).
(End)
Sum_{k=1..n} a(k) ~ n * (log(log(n)) + B - C), where B is Mertens's constant (A077761) and C = Sum_{p prime} (1/p^2) = 0.452247... (A085548). - Amiram Eldar, Sep 28 2023

A048669 The Jacobsthal function g(n): maximal gap in a list of all the integers relatively prime to n.

Original entry on oeis.org

1, 2, 2, 2, 2, 4, 2, 2, 2, 4, 2, 4, 2, 4, 3, 2, 2, 4, 2, 4, 3, 4, 2, 4, 2, 4, 2, 4, 2, 6, 2, 2, 3, 4, 3, 4, 2, 4, 3, 4, 2, 6, 2, 4, 3, 4, 2, 4, 2, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 6, 2, 4, 3, 2, 3, 6, 2, 4, 3, 6, 2, 4, 2, 4, 3, 4, 3, 6, 2, 4, 2, 4, 2, 6, 3, 4, 3, 4, 2, 6, 3, 4, 3, 4, 3, 4, 2, 4, 3, 4, 2, 6, 2, 4, 5
Offset: 1

Views

Author

Keywords

Comments

Equivalently, g(n) is the least integer such that among any g(n) consecutive integers i, i+1, ..., i+g(n)-1 there is at least one which is relatively prime to n.
The definition refers to all integers, not just those in the range 1..n-1.
Differs from A070194 by 1 at the primes. - T. D. Noe, Mar 21 2007
Jacobsthal's function is used in the proofs of Recamán's and Pomerance's conjectures on P-integers--see A192224. - Jonathan Sondow, Jun 14 2014

Examples

			g(6)=4 because the gap between 1 and 5, both being relatively prime to 6, is maximal and 5-1 = 4.
g(7)=2, because the numbers relatively prime to 7 are 1,2,3,4,5,6,8,9,10,..., and the biggest gap is 2. Similarly a(p) = 2 for any prime p. - _N. J. A. Sloane_, Sep 08 2012
		

References

  • E. Jacobsthal, Uber Sequenzen ganzer Zahlen, von denen keine zu n teilerfremd ist, I, II, III. Norske Vid. Selsk. Forh., 33, 1960, 117-139.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Pages 33-34.
  • E. Westzynthius, Uber die Verteilung der Zahlen, die zu der n ersten Primzahlen teilerfremd sind, Comm. Phys. Math. Helsingfors 25 (1931), 1-37.

Crossrefs

Essentially same as A049298. See A132468 for another version.

Programs

  • Haskell
    a048669 n = maximum $ zipWith (-) (tail ts) ts where
       ts = a038566_row n ++ [n + 1]
    -- Reinhard Zumkeller, Oct 01 2012
  • Mathematica
    g[n_] := Module[{L = 1, m = 1}, For[k = 2, k <= n+1, k++, If[GCD[k, n] == 1, If[L+m < k, m = k-L]; L = k]]; m]; Table[g[n], {n, 1, 105}] (* Jean-François Alcover, Sep 03 2013, after M. F. Hasler *)
    Table[Max[Differences[Select[Range[110],CoprimeQ[#,n]&]]],{n,110}] (* Harvey P. Dale, Jan 10 2022 *)
  • PARI
    A048669(n)=my(L=1,m=1);for(k=2,n+1,gcd(k,n)>1 && next;L+mM. F. Hasler, Sep 08 2012
    

Formula

From N. J. A. Sloane, Apr 19 2017 (Start):
g(n) = g(Rad(n)) (cf. A007947). So in studying g(n) we may focus on the case when n is a product of w (say) distinct primes.
g(n) <= 2^w for all w [Kanold].
g(n) <= 2^(1/w) for all w >= e^50 [Kanold].
For some unknown X, g(n) <= X*(w*log(w))^2 for all w [Iwaniec].
(End)
g(n) << (log(n))^2, as proved by Iwaniec. - Charles R Greathouse IV, Sep 08 2012.

Extensions

Edited, changed symbol to g(n), added references pertaining to bounds. - N. J. A. Sloane, Apr 19 2017

A058989 Largest number of consecutive integers such that each is divisible by a prime <= the n-th prime.

Original entry on oeis.org

1, 3, 5, 9, 13, 21, 25, 33, 39, 45, 57, 65, 73, 89, 99, 105, 117, 131, 151, 173, 189, 199, 215, 233, 257, 263, 281, 299, 311, 329, 353, 377, 387, 413, 431, 449, 475, 491, 509, 537, 549, 573, 599, 615, 641, 659, 685, 717, 741, 761, 797, 809, 833, 857, 875, 907, 925, 953, 977, 1001, 1029, 1057, 1097, 1109
Offset: 1

Views

Author

Jud McCranie, Jan 16 2001

Keywords

Comments

Marty Weissman conjectured that a(n)=2q-1, where q is the largest prime smaller than the n-th prime. The conjecture holds for the first few terms, but then a(n) is larger than 2q-1. Phil Carmody proved a(n)>=2q-1. Terms were calculated by Weissman, Carmody and McCranie.
A049300(n) is the smallest value of the mentioned consecutive integers. - Reinhard Zumkeller, Jun 14 2003
By Lemma 5 of Maynard, there is a constant C > 0 such that, for any n, there is a prime p <= C*exp(prime(n)) such that q - p >= a(n) where q is the smallest prime larger than p. (Probably C = 7/e^3 = 0.35... is admissible.) - Charles R Greathouse IV, Aug 01 2024

Examples

			The 4th prime is 7. Nine is the maximum number of consecutive integers such that each is divisible by 2, 3, 5 or 7. (Example: 2 through 10) So a(4)=9.
		

References

  • Dickson, L. E., History of the Theory of Numbers, Vol. 1, p. 439, Chelsea, 1952.

Crossrefs

Programs

  • Mathematica
    (* This program is not suitable to compute more than a few terms *)
    primorial[n_] := Product[Prime[k], {k, 1, n}];
    j[n_] := Module[{L = 1, m = 1}, For[k = 2, k <= n+1, k++, If[GCD[k, n] == 1, If[L+m < k, m = k-L]; L = k]]; m];
    a[1] = 1;
    a[n_] := a[n] = j[primorial[n]] - 1;
    Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 1, 10}] (* Jean-François Alcover, Sep 05 2017 *)
  • PARI
    do(n,P,R)=for(i=1,#R, if(n==R[i], return(do(n+1,P,R)))); if(#P==0, return(n-1)); my(b=0); for(i=1,#P,my(t=do(n+1,setminus(P,[P[i]]), concat(R,Mod(n,P[i])))); if(t>b,b=t)); b
    a(n)=do(1,primes(n),[]) \\ Charles R Greathouse IV, Aug 08 2024

Formula

a(n) = A048670(n) - 1. See that entry for additional information.
Iwaniec proved that a(n) << n^2*(log n)^2. - Charles R Greathouse IV, Sep 08 2012
a(n) >= (2e^gamma + o(1)) n log^2 n log log log n / (log log n)^2, see A048670. - Charles R Greathouse IV, Sep 08 2012
a(n) = 2 * A072752(n) + 1. - Mario Ziller, Dec 08 2016
See A048669 for many other bounds and references. - N. J. A. Sloane, Apr 19 2017

Extensions

Laison and Schick reference from Parthasarathy Nambi, Oct 19 2007
More terms from A048670 added by Max Alekseyev, Feb 07 2008
a(46) corrected and a(50)-a(54) added by Mario Ziller, Dec 08 2016
a(55)-a(64) from A048670 added by Constantino Calancha, Aug 05 2023

A049300 Smallest number starting a longest interval of consecutive integers, each of which is divisible by at least one of the first n primes.

Original entry on oeis.org

2, 2, 2, 2, 114, 9440, 217128, 60044, 20332472, 417086648, 74959204292, 187219155594, 79622514581574, 14478292443584, 6002108856728918, 12288083384384462, 5814429911995661690, 14719192159220252523420
Offset: 1

Views

Author

Keywords

Comments

The length of such longest interval of consecutive integers is given by A058989(n), which is the first maximal gaps A048670(n) minus 1 in the reduced residue system of consecutive primorial numbers.
Let j(m)=A048669(m) be the Jacobsthal function, i.e., the maximal distance between integers relatively prime to m. Let m=2*3*5*...*prime(n). Then a(n) is the least k>0 such that k,k+1,k+2,...,k+j(m)-2 are not coprime to m. Note that a(n) begins (or is inside) a large gap between primes. - T. D. Noe, Mar 29 2007

Examples

			Between 1 and 7, all 5 numbers (2,3,4,5,6) are divisible either by 2,3 or 5. Thus a(3)=2, the initial term. Between 113 and 127 the 13 consecutive integers are divisible by 2,5,2,3,2,7,2,11,2,3,2,5,2, each from {2,3,5,7,11}. Thus a(5)=114, the smallest with this property.
		

Crossrefs

Formula

a(n) = 1 + A128707(A002110(n)). - T. D. Noe, Mar 29 2007

Extensions

More terms from T. D. Noe, Mar 29 2007
a(11)-a(12) from Donovan Johnson, Oct 13 2009
a(13) from Donovan Johnson, Oct 20 2009
a(14) and beyond from Max Alekseyev, Nov 14 2009

A072752 Maximum gap in one-stage prime-sieves.

Original entry on oeis.org

1, 2, 4, 6, 10, 12, 16, 19, 22, 28, 32, 36, 44, 49, 52, 58, 65, 75, 86, 94, 99, 107, 116, 128, 131, 140, 149, 155, 164, 176, 188, 193, 206, 215, 224, 237, 245, 254, 268, 274, 286, 299, 307, 320, 329, 342, 358, 370, 380, 398, 404, 416, 428, 437, 453, 462, 476, 488, 500, 514, 528, 548, 554
Offset: 2

Views

Author

Mario Ziller, Jul 10 2002

Keywords

Examples

			a(5) = 6 because c(2)=2, c(3)=1, c(4)=4, c(5)=3 satisfy the requirements: 1 == 1 (mod 5), 2 == 2 (mod 3), 3 == 3 (mod 11), 4 == 4 (mod 7), 5 == 2 (mod 3), 6 == 1 (mod 5).
		

Crossrefs

Formula

For n>=2 we define a(n) = max { m IN N | EXIST c(k) IN N, k=2, .., n : FOR ALL i IN {1, .., m} EXISTS j IN {2, .., n} : i == c(j) (mod prime(j)) }.
a(n) = (A048670(n)-2)/2. - John F. Morack, Jan 24 2016
a(n) = (A058989(n) - 1)/2. - Mario Ziller, Dec 08 2016

Extensions

a(15)-a(16) from Mario Ziller, May 30 2005
a(17) from John F. Morack, Nov 13 2012
a(18) from John F. Morack, Dec 11 2012
a(19) from Mario Ziller, Apr 08 2014
a(20)-a(21) from John F. Morack, Nov 21 2014
a(22) from John F. Morack, Dec 01 2014
a(23) from John F. Morack, Dec 05 2014
a(24) from John F. Morack, Dec 14 2014
a(25) from John F. Morack, Dec 30 2014
a(26)-a(36) from Mario Ziller and John F. Morack, May 20 2015
a(37)-a(49) from John F. Morack taken from [Hagedorn], Jan 24 2016
a(46) corrected and a(50)-a(54) added by Mario Ziller, Dec 08 2016
a(55)-a(64) from A048670 by Constantino Calancha, Aug 05 2023

A132468 Longest gap between numbers relatively prime to n.

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 3, 2, 1, 1, 3, 1, 3, 2, 3, 1, 3, 1, 3, 1, 3, 1, 5, 1, 1, 2, 3, 2, 3, 1, 3, 2, 3, 1, 5, 1, 3, 2, 3, 1, 3, 1, 3, 2, 3, 1, 3, 2, 3, 2, 3, 1, 5, 1, 3, 2, 1, 2, 5, 1, 3, 2, 5, 1, 3, 1, 3, 2, 3, 2, 5, 1, 3, 1, 3, 1, 5, 2, 3, 2, 3, 1, 5, 2, 3, 2, 3, 2, 3, 1, 3, 2, 3, 1, 5, 1, 3, 4
Offset: 1

Views

Author

Michael Kleber, Nov 16 2007

Keywords

Comments

Here "gap" does not include the endpoints.
a(n) is given by the maximum length of a run of numbers satisfying one congruence modulo each of n's distinct prime factors. It follows that if m is the number of distinct prime factors of n and each of n's prime factors is greater than m then a(n) = m. - Thomas Anton, Dec 30 2018

Examples

			E.g. n=3: the longest gap in 1, 2, 4, 5, 7, ... is 1, between 2 and 4, so a(3) = 1.
		

Crossrefs

Equals A048669(n) - 1.

Programs

  • Maple
    a:=[];
    for n from 1 to 120 do
    s:=[seq(j,j=1..4*n)];
    rec:=0;
       for st from 1 to n do
       len:=0;
        for i from 1 to n while gcd(s[st+i-1],n)>1 do len:=len+1; od:
        if len>rec then rec:=len; fi;
       od:
    a:=[op(a),rec];
    od:
    a; # N. J. A. Sloane, Apr 18 2017
  • Mathematica
    a[ n_ ] := (Max[ Drop[ #,1 ]-Drop[ #,-1 ] ]-1&)[ Select[ Range[ n+1 ],GCD[ #,n ]==1& ] ]
    Do[Print[n, " ", a[n]],{n,20000}]

Formula

a(n) = 1 at every prime power.

Extensions

Incorrect formula removed by Thomas Anton, Dec 30 2018

A128707 Least number having the maximal distance between consecutive integers coprime to n.

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 6, 1, 2, 3, 10, 1, 12, 5, 4, 1, 16, 1, 18, 3, 5, 9, 22, 1, 4, 11, 2, 5, 28, 1, 30, 1, 10, 15, 13, 1, 36, 17, 11, 3, 40, 5, 42, 9, 4, 21, 46, 1, 6, 3, 16, 11, 52, 1, 9, 5, 17, 27, 58, 1, 60, 29, 5, 1, 24, 7, 66, 15, 22, 3, 70, 1, 72, 35, 4, 17, 20, 11, 78, 3, 2, 39, 82, 5, 33
Offset: 1

Views

Author

T. D. Noe, Mar 24 2007

Keywords

Comments

Let j(n) be the Jacobsthal function (A048669): maximal distance between consecutive integers coprime to n. Then a(n) is the least k>0 such that k+1,k+2,...k+j(n)-1 are not coprime to n. If n is prime and e>0, then j(n^e)=2 and a(n^e)=n-1. If n>2 is prime, then a(2n)=n-2. If m is the squarefree kernel of n (A007947), then j(n)=j(m) and a(n)=a(m). For composite n, a(n)A055932. When n is the product of the first r primes (A002110), then a(n)+1 begins (or is inside) a prime gap of size at least A048670(r).

Examples

			The numbers coprime to 10 are 1,3,7,9,11,13,17,19,... Observe that the differences are periodic: 2,4,2,2,2,4,2,... The largest distance between the coprime numbers is 4, which first occurs between 3 and 7. Hence j(10)=4 and a(10)=3.
		

Crossrefs

Cf. A128708 (number of times the maximal value occurs).

Programs

  • Mathematica
    JacobsthalPos[n_] := Module[{g,d,mx,pos}, g=Select[Range[n+1], GCD[n,# ]==1&]; d=Rest[g]-Most[g]; mx=Max@@d; pos=Position[d,mx,1,1][[1,1]]; g[[pos]]]; Table[JacobsthalPos[n], {n,100}]

A331118 Irregular triangle read by rows where row n lists primitive first differences in the reduced residue system of A002110(n).

Original entry on oeis.org

2, 2, 4, 2, 4, 6, 2, 4, 6, 8, 10, 2, 4, 6, 8, 10, 12, 14, 2, 4, 6, 8, 10, 12, 14, 16, 18, 22, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 34, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36
Offset: 1

Views

Author

Michael De Vlieger, Jan 10 2020

Keywords

Comments

Let primorial P(n) = A002110(n) and let r < P(n) be a number such that gcd(r, P(n)) = 1. Thus r is a residue in the reduced residue system (RRS) of P(n), and the number of r pertaining to P(n) is given by phi(P(n)) = A005867(n). We take the union of the first differences of the r in the RRS of P(n) to arrive at row n of this sequence.
Let L be the run length of numbers m in the cototient of a number k and let the first differences D in the RRS of k. The cototient includes any m such that at least 1 prime p | m also divides k, in other words, any m such that gcd(m, k) > 1. We note L = D - 1.
Row n of this sequence is the union of first differences of row n of A286941.
Let D be a primitive first difference as defined above. D is necessarily even since P(n) (for n > 0) is even and all r are odd.
Length of row n = A329815(n).

Examples

			Triangle begins:
n    Row
1    2;
2    2, 4;
3    2, 4, 6;
4    2, 4, 6, 8, 10;
5    2, 4, 6, 8, 10, 12, 14;
6    2, 4, 6, 8, 10, 12, 14, 16, 18,     22;
7    2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26;
8    2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30,     34;
...
(Triangle is organized so that the D appear in columns.)
Row 1 = {2} because P(1) = 2 is prime and has only 2 itself in the cototient.
Row 2 = {2, 4} since the numbers {1, 5} are coprime to P(2) = 6, and their difference is 4.
Row 3 contains {2, 4, 6} since we encounter the run lengths 6 between 1 and 7, 4 between 7 and 11, and 2 between 11 and 13. The run lengths are repeated but no new lengths appear for P(3) = 30.
		

Crossrefs

Programs

  • Mathematica
    Table[Block[{r = 1, s = {}}, Do[If[GCD[i, P] == 1, If[FreeQ[s, #], AppendTo[s, #]] &[i - r]; r = i], {i, 3, P/If[P > 6, 2, 1/2], 2}]; Union@ s], {P, FoldList[Times, Prime@ Range@ 8]}] // Flatten

Formula

A048670(n) = largest term in row n.
A329815(n) = length of row n.

A049298 Take reduced residue systems of n, generate its first differences, dRRS(n); sequence gives maximal value of dRSSS(n).

Original entry on oeis.org

0, 0, 2, 2, 2, 4, 2, 2, 2, 4, 2, 4, 2, 4, 3, 2, 2, 4, 2, 4, 3, 4, 2, 4, 2, 4, 2, 4, 2, 6, 2, 2, 3, 4, 3, 4, 2, 4, 3, 4, 2, 6, 2, 4, 3, 4, 2, 4, 2, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 6, 2, 4, 3, 2, 3, 6, 2, 4, 3, 6, 2, 4, 2, 4, 3, 4, 3, 6, 2, 4, 2, 4, 2, 6, 3, 4, 3, 4, 2, 6, 3, 4, 3, 4, 3, 4, 2, 4, 3, 4, 2, 6, 2, 4, 5
Offset: 1

Views

Author

Keywords

Comments

Greatest values occur at primorial numbers (A002110).

Examples

			If n is prime, its reduced residue system consists of all numbers below n. But the difference 2 arises from d=1-(n-1)=-n+2 (mod n).
		

Crossrefs

Cf. A048670. Essentially same as A048669.

A329815 Number of distinct terms in the first difference sequence of the reduced residue system of the n-th primorial.

Original entry on oeis.org

0, 1, 3, 5, 7, 10, 13, 16, 20, 23, 29, 33, 37, 43, 49, 53, 59, 66, 75, 84, 92, 99, 108, 116, 127, 132, 140, 148, 156, 164, 174, 185, 193, 206, 215, 224, 235, 245, 255, 267, 275, 286, 297, 308
Offset: 1

Views

Author

Jamie Morken, Nov 21 2019

Keywords

Comments

This sequence is the number of distinct terms in the first difference sequence for rows n in A286941 and A309497.
Number of distinct terms listed in row n of A331118. - Michael De Vlieger, Jul 11 2020

Examples

			For n = 3, A002110(3) = 30, RRS = {1, 7, 11, 13, 17, 19, 23, 29}, dRRS = {6, 4, 2, 4, 2, 4, 6}, so a(3) = 3.
		

Crossrefs

Programs

  • Mathematica
    Primorial[n_] := Times @@ Prime[Range[n]]; Table[Length@ Union@ Differences@ Select[Range@ Primorial[n], CoprimeQ[#, Primorial[n]] &], {n, 7}] (* after Michael De Vlieger Jul 15 2017 from A061498 *)
  • PARI
    f(n) = {my(va = select(x->(gcd(n, x)==1), [1..n])); vd = vector(#va-1, k, va[k+1] - va[k]); #Set(vd); } \\ A061498
    a(n) = f(prod(i=1, n, prime(i))); \\ Michel Marcus, Dec 19 2019

Formula

a(n) = A061498(A002110(n)).
a(n) <= A048670(n)/2.

Extensions

a(12)-a(44) from Jamie Morken, Jul 11 2020 (after Mario Ziller)
Showing 1-10 of 14 results. Next