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.

A305444 a(n) = Product_{p is odd and prime and divisor of n} (p - 2).

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, 15, 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, 33, 9, 65, 15, 21, 15, 69, 1, 71, 35, 3, 17
Offset: 1

Views

Author

Markus Sigg, Aug 12 2018

Keywords

Comments

Denominator of c_n = Product_{odd p| n} (p-1)/(p-2). Numerator is A173557. [Yamasaki and Yamasaki]. - N. J. A. Sloane, Jan 19 2020
This ratio, multiplied by the twin prime constant, occurs in the asymptotic behavior of prime gaps of size 2*n as decribed by the Hardy-Littlewood asymptotic conjecture for the number of prime pairs. See A005597 for more information. - Hugo Pfoertner, Dec 25 2024

Crossrefs

Programs

  • Maple
    A305444 := proc(n) mul(d - 2, d = numtheory[factorset](n) minus {2}) end proc:
  • Mathematica
    a[n_] := If[n == 1, 1, Times @@ (DeleteCases[FactorInteger[n][[All, 1]], 2] - 2)];
    Array[a, 100] (* Jean-François Alcover, Apr 08 2020*)
  • PARI
    a(n)={my(f=factor(n>>valuation(n,2))[,1]); prod(i=1, #f, f[i]-2)} \\ Andrew Howroyd, Aug 12 2018
    
  • Python
    from math import prod
    from sympy import primefactors
    def A305444(n): return prod(p-2 for p in primefactors(n>>(~n&n-1).bit_length())) # Chai Wah Wu, Sep 08 2023

Formula

Sum_{k=1..n} a(k) ~ c * n^2, where c = (2/3) * Product_{p prime} (1 - 3/(p*(p+1))) = 0.1950799046... . - Amiram Eldar, Nov 12 2022
a(n) = abs( Sum_{d divides n, d odd} mobius(d) * phi(d) ). - Peter Bala, Feb 01 2024
a(n) = (-1)^omega(n) * Sum_{d|n} mu(d)*phi(2*d), where omega = A001221. - Ridouane Oudra, Jul 30 2025