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-6 of 6 results.

A301868 Numbers k such that phi(k, 2) = phi(k+1, 2), where phi(k, 2) = A002472(k).

Original entry on oeis.org

1, 2, 9, 34, 50, 153, 274, 321, 2841, 4610, 7474, 8254, 10250, 13430, 22149, 38961, 51981, 86845, 91310, 198057, 237325, 367629, 374541, 394834, 419169, 489445, 513890, 516350, 519230, 570230, 717969, 1308609, 1523630, 1557909, 1753730, 1935362, 2109969, 3005409
Offset: 1

Views

Author

Amiram Eldar, Mar 28 2018

Keywords

Examples

			phi(9, 2) = phi(10, 2) = 3, thus 9 is in the sequence.
		

Crossrefs

Cf. A002472.

Programs

  • Mathematica
    seq = {}; a[n_] := If[Head[r = Reduce[GCD[x, n] == 1 && GCD[x + 2, n] == 1 && 1 <= x <= n, x, Integers]] === Or, Length[r], 1]; a0 = a[1]; Do[
    a1 = a[k + 1]; If[a1 == a0, AppendTo[seq, k]]; a0 = a1, {k, 1, 1000}]; seq (* after Jean-François Alcover at A002472 *)
  • PARI
    f(n) = sum(x=1, n, (gcd(n, x) == 1) && (gcd(n, x+2) == 1));
    isok(n) = f(n) == f(n+1); \\ Michel Marcus, Apr 09 2018

Extensions

a(20)-a(29) from Robert Price, May 18 2018
More terms from Amiram Eldar, Mar 26 2023

A058026 Number of positive integers, k, where k <= n and gcd(k,n) = gcd(k+1,n) = 1.

Original entry on oeis.org

1, 0, 1, 0, 3, 0, 5, 0, 3, 0, 9, 0, 11, 0, 3, 0, 15, 0, 17, 0, 5, 0, 21, 0, 15, 0, 9, 0, 27, 0, 29, 0, 9, 0, 15, 0, 35, 0, 11, 0, 39, 0, 41, 0, 9, 0, 45, 0, 35, 0, 15, 0, 51, 0, 27, 0, 17, 0, 57, 0, 59, 0, 15, 0, 33, 0, 65, 0, 21, 0, 69, 0, 71, 0, 15, 0, 45, 0, 77, 0, 27, 0, 81, 0, 45, 0, 27, 0
Offset: 1

Views

Author

Leroy Quet, Nov 15 2000

Keywords

Comments

Called the Schemmel totient function in the Handbook of Number Theory II. - R. J. Mathar, Apr 15 2011
a(n) is also the number of units u in Z/nZ such that Phi(1,u) or Phi(2,u) is a unit, where Phi is the cyclotomic polynomial. - Jordan Lenchitz, Jul 12 2017
This is the function phi(n, 1) in Alder. - Michel Marcus, Nov 14 2017

Examples

			a(15) = 3 because 1 and 2, 7 and 8 and 13 and 14 are all relatively prime to 15.
a(15) = a(3*5) = a(3)*a(5) = 3^0*(3-2)*5^0*(5-2) = 3.
		

References

  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 3, p. 276.

Crossrefs

Cf. A000010 (phi(n,0)), A002472 (phi(n,2)).

Programs

  • Haskell
    a058026 n = product $ zipWith (\p e -> p ^ (e - 1) * (p - 2))
                                  (a027748_row n) (a124010_row n)
    -- Reinhard Zumkeller, May 10 2014
    
  • Maple
    A058026 := proc(n) local a; a := n ; for p in numtheory[factorset](n) do a := a*(1-2/p) ; end do: a ; end proc: # R. J. Mathar, Apr 15 2011
  • Mathematica
    a[n_] := DivisorSum[n, n/# MoebiusMu[#] DivisorSigma[0, #]&]; Array[a, 90] (* Jean-François Alcover, Dec 05 2015 *)
    f[p_, e_] := (p-2) * p^(e-1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, May 01 2020 *)
  • PARI
    a(n) = sumdiv(n, d, n/d*moebius(d)*numdiv(d)); \\ Michel Marcus, Apr 27 2014
    
  • PARI
    a(n) = n*prod(p=1, n, if (isprime(p) && !(n % p), (1-2/p), 1)); \\ Michel Marcus, Feb 02 2016
    
  • PARI
    a(n) = my(r=1,f=factor(n)); for(j=1, #f[,1], my(p=f[j,1],e=f[j,2]); r*=(p-2)*p^(e-1)); return(r); \\ Jianing Song, Nov 01 2022

Formula

Multiplicative with a(p^e) = p^(e-1)*(p-2). - Vladeta Jovovic, Dec 01 2001
a(n) = Sum_{d|n} n/d*mu(d)*tau(d). - Vladeta Jovovic, Apr 29 2002
a(n) = Sum_{d divides n} phi(n/d)*(-1)^omega(d). - Vladeta Jovovic, Sep 26 2002
A003557(n) | a(n). - R. J. Mathar, Mar 30 2011
a(n) = n*Product_{primes p|n} (1-2/p). Dirichlet g.f. zeta(s-1)*product_p (1-2*p^(-s)). - R. J. Mathar, Apr 15 2011
a(n) = phi(n) * Sum_{d|n} mu(d)/phi(d), where mu(k) is the Moebius function and phi(k) is the Euler totient function. - Daniel Suteu, Jun 23 2018
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = A065474 = Product_{primes p} (1 - 2/p^2) = 0.32263409893924467057953169254823706657095... - Vaclav Kotesovec, Dec 18 2019, corrected May 22 2025 (typo found by Amiram Eldar)
a(n) = Sum_{k=1..n} (-1)^omega(gcd(n,k)). - Ilya Gutkovskiy, Feb 22 2020
a(n) = Sum_{d1|n} Sum_{d2|n} mu(d1*d2)*floor(n/(d1*d2)). - Ridouane Oudra, Dec 31 2022

A319516 Number of integers x such that 1 <= x <= n and gcd(x,n) = gcd(x+2,n) = gcd(x+6,n) = gcd(x+8,n) = 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 3, 4, 3, 1, 7, 2, 9, 3, 1, 8, 13, 3, 15, 2, 3, 7, 19, 4, 5, 9, 9, 6, 25, 1, 27, 16, 7, 13, 3, 6, 33, 15, 9, 4, 37, 3, 39, 14, 3, 19, 43, 8, 21, 5, 13, 18, 49, 9, 7, 12, 15, 25, 55, 2, 57, 27, 9, 32, 9, 7, 63, 26, 19, 3, 67, 12, 69, 33, 5, 30, 21, 9, 75, 8
Offset: 1

Views

Author

Alexei Kourbatov, Sep 21 2018

Keywords

Comments

Equivalently, a(n) is the number of "admissible" residue classes modulo n which are allowed (by divisibility considerations) to contain infinitely many initial primes in prime quadruples (p, p+2, p+6, p+8). This is a generalization of Euler's totient function: the number of residue classes modulo n containing infinitely many primes.
If n is prime, a(n) = max(1,n-4).

Examples

			Some prime quadruples start with a prime congruent to 1 mod 4; others start with a prime congruent to 3 mod 4; that is, there are 2 "admissible" residue classes mod 4; therefore a(4)=2. All initial primes in prime quadruples are 5 mod 6; that is, there is only one "admissible" residue class mod 6; therefore a(6) = 1.
		

References

  • V. A. Golubev, Sur certaines fonctions multiplicatives et le problème des jumeaux. Mathesis 67 (1958), 11-20.
  • József Sándor and Borislav Crstici, Handbook of Number Theory II, Kluwer, 2004, p. 289.

Crossrefs

Cf. similar generalizations of totient for k-tuples: A002472 (k=2), A319534 (k=3), A321029 (k=5), A321030 (k=6).

Programs

  • Mathematica
    a[n_] := Sum[Boole[CoprimeQ[n, x] && CoprimeQ[n, x+2] && CoprimeQ[n, x+6] && CoprimeQ[n, x+8]], {x, 1, n}]; Array[a, 80] (* Jean-François Alcover, Jan 29 2019 *)
    f[p_, e_] := If[p < 7, p^(e-1), (p-4)*p^(e-1)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 22 2020 *)
  • PARI
    phi4(n) = sum(x=1, n, (gcd(n,x)==1) && (gcd(n,x+2)==1) && (gcd(n,x+6)==1) && (gcd(n,x+8)==1));
    for(n=1,80,print1(phi4(n)","))

Formula

Multiplicative with a(p^e) = p^(e-1) if p <= 5; (p-4)*p^(e-1) if p > 5.
Sum_{k=1..n} a(k) ~ c * n^2, where c = (49/200) * Product_{p prime >= 7} (1 - 4/p^2) = 0.1987646881... . - Amiram Eldar, Nov 01 2022

A319534 Number of integers x such that 1 <= x <= n and gcd(x,n) = gcd(x+2,n) = gcd(x+6,n) = 1.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 4, 4, 3, 2, 8, 2, 10, 4, 2, 8, 14, 3, 16, 4, 4, 8, 20, 4, 10, 10, 9, 8, 26, 2, 28, 16, 8, 14, 8, 6, 34, 16, 10, 8, 38, 4, 40, 16, 6, 20, 44, 8, 28, 10, 14, 20, 50, 9, 16, 16, 16, 26, 56, 4, 58, 28, 12, 32, 20, 8, 64, 28, 20, 8, 68, 12, 70, 34, 10, 32, 32, 10, 76, 16
Offset: 1

Views

Author

Alexei Kourbatov, Sep 22 2018

Keywords

Comments

Equivalently, a(n) is the number of "admissible" residue classes modulo n which are allowed (by divisibility considerations) to contain infinitely many initial primes in prime triples (p, p+2, p+6). This sequence also gives the number of "admissible" residue classes (mod n) for initial primes p in the other type of prime triples: (p,p+4,p+6). This is a generalization of Euler's totient function (the number of residue classes modulo n containing infinitely many primes).
If n is prime, a(n) = max(1,n-3).

Examples

			All initial primes p in prime triples (p, p+2, p+6) are congruent to 5 mod 6; that is, there is only one "admissible" residue class mod 6; therefore a(6) = 1.
		

References

  • V. A. Golubev, Sur certaines fonctions multiplicatives et le problème des jumeaux. Mathesis 67 (1958), 11-20.
  • József Sándor and Borislav Crstici, Handbook of Number Theory II, Kluwer, 2004, p. 289.

Crossrefs

Cf. similar generalizations of totient for k-tuples: A002472 (k=2), A319516 (k=4), A321029 (k=5), A321030 (k=6).

Programs

  • Mathematica
    a[n_] := Sum[Boole[CoprimeQ[n, x] && CoprimeQ[n, x+2] && CoprimeQ[n, x+6]], {x, 1, n}]; Array[a, 80] (* Jean-François Alcover, Jan 29 2019 *)
    f[p_, e_] := If[p < 5, p^(e-1), (p-3)*p^(e-1)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 22 2020 *)
  • PARI
    phi3(n) = sum(x=1, n, (gcd(n, x)==1) && (gcd(n, x+2)==1) && (gcd(n, x+6)==1));
    for(n=1, 80, print1(phi3(n)", "))

Formula

Multiplicative with a(p^e) = p^(e-1) if p = 2,3; (p-3)*p^(e-1) if p > 3.
Sum_{k=1..n} a(k) ~ c * n^2, where c = (7/24) * Product_{p prime >= 5} (1 - 3/p^2) = 0.2196022165... . - Amiram Eldar, Nov 01 2022

A321029 Number of integers x such that 1 <= x <= n and gcd(x,n) = gcd(x+4,n) = gcd(x+6,n) = gcd(x+10,n) = gcd(x+12,n) = 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 4, 3, 1, 6, 2, 8, 2, 1, 8, 12, 3, 14, 2, 2, 6, 18, 4, 5, 8, 9, 4, 24, 1, 26, 16, 6, 12, 2, 6, 32, 14, 8, 4, 36, 2, 38, 12, 3, 18, 42, 8, 14, 5, 12, 16, 48, 9, 6, 8, 14, 24, 54, 2, 56, 26, 6, 32, 8, 6, 62, 24, 18, 2, 66, 12, 68, 32, 5, 28, 12, 8, 74, 8
Offset: 1

Views

Author

Alexei Kourbatov, Oct 26 2018

Keywords

Comments

Equivalently, a(n) is the number of "admissible" residue classes modulo n which are allowed (by divisibility considerations) to contain infinitely many initial primes p in prime 5-tuples (p, p+4, p+6, p+10, p+12). This sequence also gives the number of "admissible" residue classes (mod n) for initial primes p in the other type of prime 5-tuples: (p, p+2, p+6, p+8, p+12). This sequence is a generalization of Euler's totient function (A000010(n), the number of residue classes modulo n containing infinitely many primes).
If n is prime, a(n) = max(1,n-5).

Examples

			All initial primes p in prime 5-tuples (p, p+4, p+6, p+10, p+12) are congruent to 7 mod 10; that is, there is only one "admissible" residue class mod 10; therefore a(10) = 1.
		

References

  • V. A. Golubev, Sur certaines fonctions multiplicatives et le problème des jumeaux. Mathesis 67 (1958), 11-20.
  • József Sándor and Borislav Crstici, Handbook of Number Theory II, Kluwer, 2004, p. 289.

Crossrefs

Cf. similar generalizations of totient for k-tuples: A002472 (k=2), A319534 (k=3), A319516 (k=4), A321030 (k=6).

Programs

  • Mathematica
    Table[Count[Range@ n, x_ /; Equal @@ Append[Map[GCD[# + x, n] &, {0, 4, 6, 10, 12}], 1]], {n, 80}] (* Michael De Vlieger, Nov 13 2018 *)
    f[p_, e_] := If[p < 7, p^(e-1), (p-5)*p^(e-1)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 22 2020 *)
  • PARI
    phi5(n) = sum(x=1, n, (gcd(n, x)==1) && (gcd(n, x+4)==1) && (gcd(n, x+6)==1) && (gcd(n, x+10)==1) && (gcd(n, x+12)==1));
    for(n=1, 80, print1(phi5(n)", "))

Formula

Multiplicative with a(p^e) = p^(e-1) if p <= 5; (p-5)*p^(e-1) if p >= 7.
Sum_{k=1..n} a(k) ~ c * n^2, where c = (49/200) * Product_{p prime >= 7} (1 - 5/p^2) = 0.1883521849... . - Amiram Eldar, Nov 01 2022

A321030 Number of integers x such that 1 <= x <= n and gcd(x,n) = gcd(x+4,n) = gcd(x+6,n) = gcd(x+10,n) = gcd(x+12,n) = gcd(x+16,n) = 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 4, 3, 1, 5, 2, 7, 1, 1, 8, 11, 3, 13, 2, 1, 5, 17, 4, 5, 7, 9, 2, 23, 1, 25, 16, 5, 11, 1, 6, 31, 13, 7, 4, 35, 1, 37, 10, 3, 17, 41, 8, 7, 5, 11, 14, 47, 9, 5, 4, 13, 23, 53, 2, 55, 25, 3, 32, 7, 5, 61, 22, 17, 1, 65, 12, 67, 31, 5, 26, 5, 7, 73, 8
Offset: 1

Views

Author

Alexei Kourbatov, Oct 26 2018

Keywords

Comments

Equivalently, a(n) is the number of "admissible" residue classes modulo n which are allowed (by divisibility considerations) to contain infinitely many initial primes in prime 6-tuples (p, p+4, p+6, p+10, p+12, p+16). This is a generalization of Euler's totient function (A000010(n), the number of residue classes modulo n containing infinitely many primes).
If n is prime, a(n) = max(1,n-6).

Examples

			All initial primes p in prime 6-tuples (p, p+4, p+6, p+10, p+12, p+16) are congruent to 7 mod 10; that is, there is only one "admissible" residue class mod 10; therefore a(10) = 1.
		

References

  • V. A. Golubev, Sur certaines fonctions multiplicatives et le problème des jumeaux. Mathesis 67 (1958), 11-20.
  • József Sándor and Borislav Crstici, Handbook of Number Theory II, Kluwer, 2004, p. 289.

Crossrefs

Cf. similar generalizations of totient for k-tuples: A002472 (k=2), A319534 (k=3), A319516 (k=4), A321029 (k=5).

Programs

  • Mathematica
    Table[Count[Range@ n, x_ /; Equal @@ Append[Map[GCD[# + x, n] &, {0, 4, 6, 10, 12, 16}], 1]], {n, 80}] (* Michael De Vlieger, Nov 13 2018 *)
    f[p_, e_] := If[p <= 7, p^(e-1), (p-6)*p^(e-1)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 22 2020 *)
  • PARI
    phi6(n) = sum(x=1, n, (gcd(n, x)==1) && (gcd(n, x+4)==1) && (gcd(n, x+6)==1) && (gcd(n, x+10)==1) && (gcd(n, x+12)==1) && (gcd(n, x+16)==1));
    for(n=1, 80, print1(phi6(n)", "))

Formula

Multiplicative with a(p^e) = p^(e-1) if p <= 7; (p-6)*p^(e-1) if p > 7.
Sum_{k=1..n} a(k) ~ c * n^2, where c = (43/200) * Product_{p prime >= 11} (1 - 6/p^2) = 0.1783680033... . - Amiram Eldar, Nov 01 2022
Showing 1-6 of 6 results.