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

A173557 a(n) = Product_{primes p dividing n} (p-1).

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 6, 1, 2, 4, 10, 2, 12, 6, 8, 1, 16, 2, 18, 4, 12, 10, 22, 2, 4, 12, 2, 6, 28, 8, 30, 1, 20, 16, 24, 2, 36, 18, 24, 4, 40, 12, 42, 10, 8, 22, 46, 2, 6, 4, 32, 12, 52, 2, 40, 6, 36, 28, 58, 8, 60, 30, 12, 1, 48, 20, 66, 16, 44, 24, 70, 2, 72, 36
Offset: 1

Views

Author

Keywords

Comments

This is A023900 without the signs. - T. D. Noe, Jul 31 2013
Numerator of c_n = Product_{odd p| n} (p-1)/(p-2). Denominator is A305444. The initial values c_1, c_2, ... are 1, 1, 2, 1, 4/3, 2, 6/5, 1, 2, 4/3, 10/9, 2, 12/11, 6/5, 8/3, 1, 16/15, ... [Yamasaki and Yamasaki]. - N. J. A. Sloane, Jan 19 2020
Kim et al. (2019) named this function the absolute Möbius divisor function. - Amiram Eldar, Apr 08 2020

Examples

			300 = 3*5^2*2^2 => a(300) = (3-1)*(2-1)*(5-1) = 8.
		

Crossrefs

Programs

  • Haskell
    a173557 1 = 1
    a173557 n = product $ map (subtract 1) $ a027748_row n
    -- Reinhard Zumkeller, Jun 01 2015
    
  • Magma
    [EulerPhi(n)/(&+[(Floor(k^n/n)-Floor((k^n-1)/n)): k in [1..n]]): n in [1..100]]; // Vincenzo Librandi, Jan 20 2020
    
  • Maple
    A173557 := proc(n) local dvs; dvs := numtheory[factorset](n) ; mul(d-1,d=dvs) ; end proc: # R. J. Mathar, Feb 02 2011
    # second Maple program:
    a:= n-> mul(i[1]-1, i=ifactors(n)[2]):
    seq(a(n), n=1..80);  # Alois P. Heinz, Aug 27 2018
  • Mathematica
    a[n_] := Module[{fac = FactorInteger[n]}, If[n==1, 1, Product[fac[[i, 1]]-1, {i, Length[fac]}]]]; Table[a[n], {n, 100}]
  • PARI
    a(n) = my(f=factor(n)[,1]); prod(k=1, #f, f[k]-1); \\ Michel Marcus, Oct 31 2017
    
  • PARI
    for(n=1, 100, print1(direuler(p=2, n, (1 - 2*X + p*X)/(1 - X))[n], ", ")) \\ Vaclav Kotesovec, Jun 18 2020
    
  • PARI
    apply( {A173557(n)=vecprod([p-1|p<-factor(n)[,1]])}, [1..77]) \\ M. F. Hasler, Aug 14 2021
    
  • Python
    from math import prod
    from sympy import primefactors
    def A173557(n): return prod(p-1 for p in primefactors(n)) # Chai Wah Wu, Sep 08 2023
  • Scheme
    ;; With memoization-macro definec.
    (definec (A173557 n) (if (= 1 n) 1 (* (- (A020639 n) 1) (A173557 (A028234 n))))) ;; Antti Karttunen, Nov 28 2017
    

Formula

a(n) = A003958(n) iff n is squarefree. a(n) = |A023900(n)|.
Multiplicative with a(p^e) = p-1, e >= 1. - R. J. Mathar, Mar 30 2011
a(n) = phi(rad(n)) = A000010(A007947(n)). - Enrique Pérez Herrero, May 30 2012
a(n) = A000010(n) / A003557(n). - Jason Kimberley, Dec 09 2012
Dirichlet g.f.: zeta(s) * Product_{p prime} (1 - 2p^(-s) + p^(1-s)). The Dirichlet inverse is multiplicative with b(p^e) = (1 - p) * (2 - p)^(e - 1) = Sum_k A118800(e, k) * p^k. - Álvar Ibeas, Nov 24 2017
a(1) = 1; for n > 1, a(n) = (A020639(n)-1) * a(A028234(n)). - Antti Karttunen, Nov 28 2017
From Vaclav Kotesovec, Jun 18 2020: (Start)
Dirichlet g.f.: zeta(s) * zeta(s-1) / zeta(2*s-2) * Product_{p prime} (1 - 2/(p + p^s)).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = A307868 = Product_{p prime} (1 - 2/(p*(p+1))) = 0.471680613612997868... (End)
a(n) = (-1)^A001221(n)*A023900(n). - M. F. Hasler, Aug 14 2021

Extensions

Definition corrected by M. F. Hasler, Aug 14 2021
Incorrect formula removed by Pontus von Brömssen, Aug 15 2021

A307410 Numerators of the product in the singular series.

Original entry on oeis.org

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

Views

Author

Mats Granvik, Apr 07 2019

Keywords

Comments

Differs from A305444 at n = 35, 65, 70, ...

Crossrefs

Cf. A005596, A005597, A305444, A380839 (denominators).

Programs

  • Maple
    f:= proc(n) numer(mul((p-2)/(p-1),p=select(type,numtheory:-factorset(n),odd))) end proc:
    map(f, [$1..100]); # Robert Israel, Apr 07 2019
  • Mathematica
    Table[Times@@(DeleteDuplicates[DeleteCases[DeleteCases[Exp[MangoldtLambda[Divisors[h]]], 1],2]] - 2)/Times@@(DeleteDuplicates[DeleteCases[DeleteCases[Exp[MangoldtLambda[Divisors[h]]], 1], 2]] - 1), {h, 1, 85}]
    Numerator[%]
    f[p_, e_] := If[p == 2, 1, (p-2)/(p-1)]; a[n_] := Numerator[Times @@ f @@@ FactorInteger[n]]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Mar 03 2025 *)
  • PARI
    a(n) = my(f=factor(n)[,1]~); numerator(prod(k=1, #f, if (f[k]>2, (f[k]-2)/(f[k]-1), 1))); \\ Michel Marcus, Apr 07 2019

Formula

a(n) = numerator of Product_{p|n;p>2}(p-2)/(p-1) where p is a prime number.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k)/A380839(k) = 2 * Product_{p prime} (1-1/(p^2-p)) = 2 * A005596 = 0.7479116272384045761094... . - Amiram Eldar, Mar 03 2025

A380839 Numerators of J(n) = Product_{p|n, p odd prime} (p - 1)/(p - 2).

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 6, 1, 2, 4, 10, 2, 12, 6, 8, 1, 16, 2, 18, 4, 12, 10, 22, 2, 4, 12, 2, 6, 28, 8, 30, 1, 20, 16, 8, 2, 36, 18, 24, 4, 40, 12, 42, 10, 8, 22, 46, 2, 6, 4, 32, 12, 52, 2, 40, 6, 36, 28, 58, 8, 60, 30, 12, 1, 16, 20, 66, 16, 44, 8, 70, 2, 72, 36
Offset: 1

Views

Author

Artur Jasinski, Feb 05 2025

Keywords

Comments

This sequence is similar to A173557 but differences occurs for indices n=35,65,70,...
Coefficients J(n)=a(n)/A307410(n) occurs in many formulas on density of primes with gap 2*n.
Sylvester was the first who uses these coefficients at 1871.

Examples

			1, 1, 2, 1, 4/3, 2, 6/5, 1, 2, 4/3, 10/9, 2, 12/11, ...
a(35) = 8 because 35 = 5 * 7 and then product is ((5-1)/(5-2))*((7-1)/(7-2)) = 8/5.
		

Crossrefs

Cf. A167864, A173557, A305444, A307410 (denominators).

Programs

  • Mathematica
    j = {}; Do[prod = 1; Do[If[PrimeQ[n] && IntegerQ[d/n], prod = prod (n - 1)/(n - 2)], {n, 3, d}]; AppendTo[j, prod], {d, 1, 74}]; Numerator[j]
    f[p_, e_] := If[p == 2, 1, (p-1)/(p-2)]; a[n_] := Numerator[Times @@ f @@@ FactorInteger[n]]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Mar 03 2025 *)
  • PARI
    a(n) = my(f=factor(n)[,1]); numerator(prod(k=1, #f, if ((p=f[k])>2, (p-1)/(p-2), 1))); \\ Michel Marcus, Feb 05 2025

Formula

a(n) = numerator(A173557(n)/A305444(n)).
a(p^n) = p - 1 for prime p.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k)/A307410(k) = Product_{prime p > 2} (1 + 1/(p*(p-2))) = 1.51478012... (A167864). - Amiram Eldar, Mar 03 2025

A380139 Prime gaps between 10^m and 10^(m+1), m>=0, sorted first by falling number of occurrences and then by rising gap size, written as an irregular triangle.

Original entry on oeis.org

2, 1, 4, 4, 6, 2, 8, 6, 4, 2, 10, 8, 12, 14, 18, 20, 6, 2, 4, 10, 12, 8, 14, 18, 16, 22, 24, 20, 30, 28, 26, 34, 32, 36, 6, 2, 4, 12, 10, 8, 18, 14, 16, 20, 22, 24, 30, 28, 26, 36, 32, 34, 40, 38, 42, 52, 44, 50, 46, 54, 58, 48, 56, 60, 62, 64, 72
Offset: 1

Views

Author

Hugo Pfoertner based on an idea by Richard Stephen Donovan, Jan 23 2025

Keywords

Comments

A gap between two primes p1 and p2 is assumed to belong to the range [10^m .. 10^(m+1)[ if 10^m <= (p1+p2)/2 < 10^(m+1). Thus the gap between 7 and 11 is counted in the interval 1 .. 10. Gaps symmetric to 10^k occur for k = 17, 45, ... .

Examples

			The triangle begins, with corresponding counts in [...]:
  [2, 1, 1]
   2, 1, 4,
  [7, 7, 6, 1]
   4, 6, 2, 8,
  [37, 32, 27, 16, 14,  8,  7,  1,  1]
    6,  4,  2, 10,  8, 12, 14, 18, 20
  [255, 170, 162, 103, 98, 86, 47, 39, 33, 16, 15, 14, 11,  5,  3,  3,  1,  1]
    6,   2,   4,   10, 12,  8, 14, 18, 16, 22, 24, 20, 30, 28, 26, 34, 32, 36,
  [1641, 1018, 1013, 860, 797, 672, 474, 430, 306, 223, 207, 191, 135, 93, 85, ...]
     6,    2,    4,   12,  10,  8,   18,  14,  16,  20,  22,  24,  30, 28, 26, ...
  [11609, 7040, 6945, 6928, 6163, 4796, 4395, 3749, 2542, 2476, 2164, 1949, ...]
     6,    12,    2,    4,   10,    8,   18,   14,   16,   24,   20,   22,  ...
  6, 12, 2, 4, 10, 18, 8, 14, 24, 16, 30, 20, 22, 28, 26, 36, 42, 34, ...
  6, 12, 4, 2, 10, 18, 8, 14, 24, 30, 16, 20, 22, 28, 26, 36, 42, 34, ...
  6, 12, 10, 4, 2, 18, 8, 14, 24, 30, 16, 20, 22, 28, 36, 26, 42, 34, ...
  6, 12, 18, 10, 2, 4, 8, 24, 30, 14, 20, 16, 22, 36, 28, 26, 42, 34, ...
		

Crossrefs

Cf. A005597, A173557, A305444 for the asymptotic behavior of gap sizes.
Showing 1-4 of 4 results.