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

A048272 Number of odd divisors of n minus number of even divisors of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

abs(a(n)) = (1/2) * (number of pairs (i,j) satisfying n = i^2 - j^2 and -n <= i,j <= n). - Benoit Cloitre, Jun 14 2003
As A001227(n) is the number of ways to write n as the difference of 3-gonal numbers, a(n) describes the number of ways to write n as the difference of e-gonal numbers for e in {0,1,4,8}. If pe(n):=(1/2)*n*((e-2)*n+(4-e)) is the n-th e-gonal number, then 4*a(n) = |{(m,k) of Z X Z; pe(-1)(m+k)-pe(m-1)=n}| for e=1, 2*a(n) = |{(m,k) of Z X Z; pe(-1)(m+k)-pe(m-1)=n}| for e in {0,4} and for a(n) itself is a(n) = |{(m,k) of Z X Z; pe(-1)(m+k)-pe(m-1)=n}| for e=8. (Same for e=-1 see A035218.) - Volker Schmitt (clamsi(AT)gmx.net), Nov 09 2004
An argument by Gareth McCaughan suggests that the average of this sequence is log(2). - Hans Havermann, Feb 10 2013 [Supported by a graph. - Vaclav Kotesovec, Mar 01 2023]
From Keith F. Lynch, Jan 20 2024: (Start)
a(n) takes every possible integer value, positive, negative, and zero. Proof: For all nonnegative integers k, a(3^k) = 1+k, a(2^k) = 1-k.
a(n) takes every possible integer value except 1 and -1 infinitely many times. Proof: a(o^(k-1)) = k and a(4*o^(k-1)) = -k for all positive integers k and odd primes o, of which there are infinitely many. a(n) = 0 iff n = 2 (mod 4). a(n) = 1 iff n = 1. a(n) = -1 iff n = 4.
a(n) takes prime value p only for n = o^(p-1), where o is any odd prime.
Terms have a simple pattern that repeats with a period of 4: Positive, zero, positive, negative.
(End)
Inverse Möbius transform of (-1)^(n+1). - Wesley Ivan Hurt, Jun 22 2024

Examples

			a(20) = -2 because 20 = 2^2*5^1 and (1-2)*(1+1) = -2.
G.f. = x + 2*x^3 - x^4 + 2*x^5 + 2*x^7 - 2*x^8 + 3*x^9 + 2*x^11 - 2*x^12 + ...
		

References

  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 162, #16, (6), first formula.
  • S. Ramanujan, Notebooks, Tata Institute of Fundamental Research, Bombay 1957 Vol. 1, see page 97, 7(ii).

Crossrefs

Cf. A048298. A diagonal of A060184.
First differences of A059851.
Indices of records: A053624 (highs), A369151 (lows).

Programs

  • Haskell
    a048272 n = a001227 n - a183063 n  -- Reinhard Zumkeller, Jan 21 2012
    
  • Magma
    [&+[(-1)^(d+1):d in Divisors(n)] :n in [1..95] ]; // Marius A. Burtea, Aug 10 2019
  • Maple
    add(x^n/(1+x^n), n=1..60): series(%,x,59);
    A048272 := proc(n)
        local a;
        a := 1 ;
        for pfac in ifactors(n)[2] do
            if pfac[1] = 2 then
                a := a*(1-pfac[2]) ;
            else
                a := a*(pfac[2]+1) ;
            end if;
        end do:
        a ;
    end proc: # Schmitt, sign corrected R. J. Mathar, Jun 18 2016
    # alternative Maple program:
    a:= n-> -add((-1)^d, d=numtheory[divisors](n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 28 2018
  • Mathematica
    Rest[ CoefficientList[ Series[ Sum[x^k/(1 - (-x)^k), {k, 111}], {x, 0, 110}], x]] (* Robert G. Wilson v, Sep 20 2005 *)
    dif[n_]:=Module[{divs=Divisors[n]},Count[divs,?OddQ]-Count[ divs, ?EvenQ]]; Array[dif,100] (* Harvey P. Dale, Aug 21 2011 *)
    a[n]:=Sum[-(-1)^d,{d,Divisors[n]}] (* Steven Foster Clark, May 04 2018 *)
    f[p_, e_] := If[p == 2, 1 - e, 1 + e]; a[n_] := Times @@ f @@@ FactorInteger[n]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Jun 09 2022 *)
  • PARI
    {a(n) = if( n<1, 0, -sumdiv(n, d, (-1)^d))}; /* Michael Somos, Jul 22 2006 */
    
  • PARI
    N=17; default(seriesprecision,N); x=z+O(z^(N+1))
    c=sum(j=1,N,j*x^j); \\ log case
    s=-log(prod(j=1,N,(1+x^j)^(1/j)));
    s=serconvol(s,c)
    v=Vec(s) \\ Joerg Arndt, May 03 2008
    
  • PARI
    a(n)=my(o=valuation(n,2),f=factor(n>>o)[,2]);(1-o)*prod(i=1,#f,f[i]+1) \\ Charles R Greathouse IV, Feb 10 2013
    
  • PARI
    a(n)=direuler(p=1,n,if(p==2,(1-2*X)/(1-X)^2,1/(1-X)^2))[n] /* Ralf Stephan, Mar 27 2015 */
    
  • PARI
    {a(n) = my(d = n -> if(frac(n), 0, numdiv(n))); if( n<1, 0, if( n%4, 1, -1) * (d(n) - 2*d(n/2) + 2*d(n/4)))}; /* Michael Somos, Aug 11 2017 */
    

Formula

Coefficients in expansion of Sum_{n >= 1} x^n/(1+x^n) = Sum_{n >= 1} (-1)^(n-1)*x^n/(1-x^n). Expand Sum 1/(1+x^n) in powers of 1/x.
If n = 2^p1*3^p2*5^p3*7^p4*11^p5*..., a(n) = (1-p1)*Product_{i>=2} (1+p_i).
Multiplicative with a(2^e) = 1 - e and a(p^e) = 1 + e if p > 2. - Vladeta Jovovic, Jan 27 2002
a(n) = (-1)*Sum_{d|n} (-1)^d. - Benoit Cloitre, May 12 2003
Moebius transform is period 2 sequence [1, -1, ...]. - Michael Somos, Jul 22 2006
G.f.: Sum_{k>0} -(-1)^k * x^(k^2) * (1 + x^(2*k)) / (1 - x^(2*k)) [Ramanujan]. - Michael Somos, Jul 22 2006
Equals A051731 * [1, -1, 1, -1, 1, ...]. - Gary W. Adamson, Nov 07 2007
From Reinhard Zumkeller, Jan 21 2012: (Start)
a(n) = A001227(n) - A183063(n).
a(A008586(n)) < 0; a(A005843(n)) <= 0; a(A016825(n)) = 0; a(A042968(n)) >= 0; a(A005408(n)) > 0. (End)
a(n) = Sum_{k=0..n} A081362(k)*A015723(n-k). - Mircea Merca, Feb 26 2014
abs(a(n)) = A112329(n) = A094572(n) / 2. - Ray Chandler, Aug 23 2014
From Peter Bala, Jan 07 2015: (Start)
Logarithmic g.f.: log( Product_{n >= 1} (1 + x^n)^(1/n) ) = Sum_{n >= 1} a(n)*x^n/n.
a(n) = A001227(n) - A183063(n). By considering the logarithmic generating functions of these three sequences we obtain the identity
( Product_{n >= 0} (1 - x^(2*n+1))^(1/(2*n+1)) )^2 = Product_{n >= 1} ( (1 - x^n)/(1 + x^n) )^(1/n). (End)
Dirichlet g.f.: zeta(s)*eta(s) = zeta(s)^2*(1-2^(-s+1)). - Ralf Stephan, Mar 27 2015
a(2*n - 1) = A099774(n). - Michael Somos, Aug 12 2017
From Paul D. Hanna, Aug 10 2019: (Start)
G.f.: Sum_{n>=0} x^n * Sum_{k=0..n} binomial(n,k) * (x^(n+1) - x^k)^(n-k) = Sum_{n>=0} a(n)*x^(2*n).
G.f.: Sum_{n>=0} x^n * Sum_{k=0..n} binomial(n,k) * (x^(n+1) + x^k)^(n-k) * (-1)^k = Sum_{n>=0} a(n)*x^(2*n). (End)
a(n) = 2*A000005(2n) - 3*A000005(n). - Ridouane Oudra, Oct 15 2019
Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k)/A000005(k) = 2*log(2)-1. - Amiram Eldar, Mar 01 2023

Extensions

New definition from Vladeta Jovovic, Jan 27 2002

A279060 Number of divisors of n of the form 6*k + 1.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Dec 05 2016

Keywords

Comments

Möbius transform is the period-6 sequence {1, 0, 0, 0, 0, 0, ...}.

Examples

			a(14) = 2 because 14 has 4 divisors {1,2,7,14} among which 2 divisors {1,7} are of the form 6*k + 1.
		

Crossrefs

Programs

  • Mathematica
    nmax = 120; CoefficientList[Series[Sum[x^k/(1 - x^(6 k)), {k, 1, nmax}], {x, 0, nmax}], x]
    nmax = 120; CoefficientList[Series[Sum[x^(6 k + 1)/(1 - x^(6 k + 1)), {k, 0, nmax}], {x, 0, nmax}], x]
    Table[Count[Divisors[n],?(Mod[#,6]==1&)],{n,0,120}] (* _Harvey P. Dale, Apr 27 2018 *)
  • PARI
    A279060(n) = if(!n,n,sumdiv(n, d, (1==(d%6)))); \\ Antti Karttunen, Jul 09 2017
    
  • Python
    from sympy import divisors
    def A279060(n): return sum(d%6 == 1 for d in divisors(n)) # David Radcliffe, Jun 19 2025

Formula

G.f.: Sum_{k>=1} x^k/(1 - x^(6*k)).
G.f.: Sum_{k>=0} x^(6*k+1)/(1 - x^(6*k+1)).
From Antti Karttunen, Oct 03 2018: (Start)
a(n) = A320001(n) + [1 == n (mod 6)], where [ ] is the Iverson bracket, giving 1 only when n = 1 mod 6, and 0 otherwise.
a(n) = A035218(n) - A319995(n). (End)
a(n) = (A035218(n) + A035178(n)) / 2. - David Radcliffe, Jun 19 2025
Sum_{k=1..n} a(k) = n*log(n)/6 + c*n + O(n^(1/3)*log(n)), where c = gamma(1,6) - (1 - gamma)/6 = 0.686263..., gamma(1,6) = -(psi(1/6) + log(6))/6 is a generalized Euler constant, and gamma is Euler's constant (A001620) (Smith and Subbarao, 1981). - Amiram Eldar, Nov 25 2023

A319995 Number of divisors of n of the form 6*k + 5.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 03 2018

Keywords

Crossrefs

Cf. A001620, A016629, A222458 (psi(5/6)).

Programs

  • Mathematica
    a[n_] := DivisorSum[n, 1 &, Mod[#, 6] == 5 &]; Array[a, 100] (* Amiram Eldar, Nov 25 2023 *)
  • PARI
    A319995(n) = if(!n,n,sumdiv(n, d, (5==(d%6))));

Formula

a(n) = A035218(n) - A279060(n).
G.f.: Sum_{k>=1} x^(5*k)/(1 - x^(6*k)). - Ilya Gutkovskiy, Sep 11 2019
Sum_{k=1..n} a(k) = n*log(n)/6 + c*n + O(n^(1/3)*log(n)), where c = gamma(5,6) - (1 - gamma)/6 = -0.220635..., gamma(5,6) = -(psi(5/6) + log(6))/6 is a generalized Euler constant, and gamma is Euler's constant (A001620) (Smith and Subbarao, 1981). - Amiram Eldar, Nov 25 2023

A320015 Number of proper divisors of n that are either of the form 6*k+1 or 6*k + 5.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 03 2018

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := DivisorSum[n, 1 &, # < n && MemberQ[{1, 5}, Mod[#, 6]] &]; Array[a, 100] (* Amiram Eldar, Nov 25 2023 *)
  • PARI
    A320015(n) = if(!n,n,sumdiv(n, d, (d
    				

Formula

a(n) = A320001(n) + A320005(n).
a(n) = A035218(n) - ch15(n), where ch15 is the characteristic function of numbers of the form +-1 mod 6, i.e., ch15(n) = A232991(n-1).
Sum_{k=1..n} a(k) = n*log(n)/3 + c*n + O(n^(1/3)*log(n)), where c = 2*(gamma + log(12)/4 - 1)/3 = 0.132294..., and gamma is Euler's constant (A001620) (Smith and Subbarao, 1981). - Amiram Eldar, Nov 25 2023

A365210 The number of divisors d of n such that gcd(d, n/d) is a 5-rough number (A007310).

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Aug 26 2023

Keywords

Comments

First differs from A034444 at n = 25.
The sum of these divisors is A365211(n).

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := If[p <= 3 , 2, e + 1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i,1] <= 3, 2, f[i,2]+1));}

Formula

Multiplicative with a(p^e) = 2 for p = 2 and 3, and a(p^e) = e+1 for a prime p >= 5.
a(n) <= A000005(n), with equality if and only if n is neither divisible by 4 nor by 9.
a(n) >= A034444(n), with equality if and only if n is not divisible by a square of a prime >= 5.
a(n) = A000005(A065330(n)) * A034444(A065331(n)).
Dirichlet g.f.: (1-1/4^s) * (1-1/9^s) * zeta(s)^2.
Sum_{k=1..n} a(k) ~ (2*n/3) * (log(n) + 2*gamma - 1 + 2*log(2)/3 + log(3)/4), where gamma is Euler's constant (A001620).

A385044 The number of unitary divisors of n that are 5-rough numbers (A007310).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 4, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 4, 2, 2, 2, 2, 2, 2, 2, 2, 1, 4, 2, 2, 2, 2, 4, 2, 1, 2, 2, 2, 2, 4, 2, 2, 2, 1, 2, 2, 2, 4, 2, 2
Offset: 1

Views

Author

Amiram Eldar, Jun 16 2025

Keywords

Comments

The sum of these divisors is A385045(n), and the largest of them is A065330(n).

Crossrefs

The unitary analog of A035218.
The number of unitary divisors of n that are: A000034 (power of 2), A055076 (exponentially odd), A056624 (square), A056671 (squarefree), A068068 (odd), A323308 (powerful), A365498 (cubefree), A365499 (biquadratefree), A368248 (cubefull), A380395 (cube), A382488 (3-smooth), A385042 (exponentially 2^n), this sequence (5-rough).

Programs

  • Mathematica
    f[p_, e_] := If[p <= 3, 1, 2]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = vecprod(apply(x -> if(x <= 3, 1, 2), factor(n)[, 1]));

Formula

Multiplicative with a(p^e) = 1 if p <= 3, and 2 if p >= 5.
a(n) = A034444(n)/A382488(n).
a(n) <= A034444(n), with equality if and only if n is 5-rough.
a(n) <= A035218(n).
Dirichlet g.f.: (zeta(s)^2/zeta(2*s)) * (1/((1+1/2^s)*(1+1/3^s))).
Sum_{k=1..n} a(k) ~ (n / (2 * zeta(2))) *(log(n) + 2*gamma - 1 + log(2)/3 + log(3)/4 - 2*zeta'(2)/zeta(2)), where gamma is Euler's constant (A001620).

A099751 Number of ways to write n as differences of (-4)-gonal numbers. If pe(n):=1/2*n*((e-2)*n+(4-e)) is the n-th e-gonal number, then a(n) = |{(m,k) of Z X Z; pe(-1)(m+k)-pe(m-1)=n}| for e=-4.

Original entry on oeis.org

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

Views

Author

Volker Schmitt (clamsi(AT)gmx.net), Nov 10 2004

Keywords

Examples

			G.f. = x + x^3 + x^4 + 2*x^5 + 2*x^7 + 2*x^8 + x^9 + 2*x^11 + x^12 + 2*x^13 + ...
a(5)=2 because there are two ways of differences: First pe(3)-pe(-2)=(-15)-(-20)=5 and second pe(1)-pe(2)=(1)-(-4)=5, for e=-4.
		

Crossrefs

Cf. A001227 for e in {3, -2, 6}, A048272 for e in {0, 1, 4, 8} and A035218 for e=-1.

Programs

  • Haskell
    a099751 n = product $ zipWith f (a027748_row n) (a124010_row n)
       where f 2 e = e - 1; f 3 e = 1; f _ e = e + 1
    -- Reinhard Zumkeller, Mar 20 2015
  • Maple
    res:=1; ifac:=op(ifactors(i))[2]; for pfac in ifac do; if pfac[1]=2 then res:=res*(pfac[2]-1); else if pfac[1]<>3 then res:=res*(pfac[2]+1); fi; fi; od; a(i):=res;
  • Mathematica
    a[ n_] := If[ n < 1, 0, If[ Divisible[n, 4], -1, 1] Sum[ KroneckerSymbol[ -3, d] (-1)^Quotient[ d, 3], {d, Divisors@n}]]; (* Michael Somos, Mar 19 2015 *)
  • PARI
    {a(n) = if( n<1, 0, if( n%2==0, (valuation(n, 2) -1) * a(n / 2^valuation(n, 2)), if( n%3==0, a(n / 3^valuation(n, 3)), numdiv(n)))) }; /* Michael Somos, Sep 20 2005 */
    
  • PARI
    {a(n) = if( n<1, 0, (-1)^(n%4 == 0) * sumdiv( n, d, (-1)^(d\3) * kronecker( -3, d)))}; /* Michael Somos, Nov 16 2011 */
    

Formula

Multiplicative with a(2^e) = e-1 if e>0, a(3^e) = 1, a(p^e) = e+1 if p>3.
Moebius transform is period 12 sequence [ 1, -1, 0, 1, 1, 0, 1, 1, 0, -1, 1, 0, ...].
G.f.: Sum_{k>0} (x^k - x^(2*k) + x^(4*k) + x^(5*k) + x^(7*k) + x^(8*k) - x^(10*k) + x^(11*k)) / (1 - x^(12*k)). - Michael Somos, Sep 20 2005
a(3*n) = a(n). a(4*n + 2) = 0. - Michael Somos, Nov 16 2011
a(4*n) = A035191(n). - Michael Somos, Mar 19 2015
From Amiram Eldar, Nov 30 2022: (Start)
Dirichlet g.f.: zeta(s)^2*(1 + 2^(1-2*s) - 2^(1-s))*(1 - 1/3^s).
Sum_{k=1..n} a(k) ~ n*log(n)/3 + (2*gamma - 1 + log(3)/2)*n/3, where gamma is Euler's constant (A001620). (End)

A366642 Lexicographically earliest sequence of distinct primes such that the sequence of ratios (number of divisors of n that are coprime to these primes)/(number of divisors of n) has an asymptotic mean 1/2.

Original entry on oeis.org

2, 3, 5, 149, 10771, 16575407, 39516855101743, 60095055821549024117399447, 96668175211190122501174866643973679330023904660323
Offset: 1

Views

Author

Amiram Eldar, Oct 15 2023

Keywords

Comments

The sequence of the number of divisors of n that are coprime to these primes is A366643.
Equivalently, a(n) is the lexicographically earliest sequence of distinct primes such that Product_{n>=1} (a(n)-1) * log(a(n)/(a(n)-1)) = 1/2.
The next term has 99 digits and is too large to be included in the data section.

Examples

			The asymptotic mean of (number of divisors of n that are coprime to 2)/A000005(n) = A001227(n)/A000005(n) is log(2) = 0.693... > 1/2. Therefore a(1) = 2.
The asymptotic mean of (number of divisors of n that are coprime to 2 and 3)/A000005(n) = A035218(n)/A000005(n) is 2*log(3/2)*log(2) = 0.562... > 1/2. Therefore a(2) = 3.
The asymptotic mean of (number of divisors of n that are coprime to 2, 3 and 5)/A000005(n) is 8*log(5/4)*log(3/2)*log(2) = 0.501... > 1/2. Therefore a(3) = 5.
The asymptotic mean of (number of divisors of n that are coprime to 2, 3, 5 and 7)/A000005(n) is 48*log(7/6)*log(5/4)*log(3/2)*log(2) = 0.464... < 1/2. Therefore a(4) is not 7.
The asymptotic mean of (number of divisors of n that are coprime to 2, 3, 5 and 149)/A000005(n) is 1184*log(149/148)*log(5/4)*log(3/2)*log(2) = 0.50002... > 1/2, and 149 is the least prime with this property. Therefore a(4) = 149.
		

Crossrefs

Programs

  • Mathematica
    g[x_] := -(x-1)*Log[1-1/x]; seq[len_] := Module[{s = {}, r = 1/2, p = 1}, Do[p = NextPrime[InverseFunction[g][r]]; AppendTo[s, p]; r /= g[p], {len}]; s]; seq[7]

A366643 a(n) is the number of divisors of n that are coprime to the terms of A366642.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 1, 3, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 4, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Amiram Eldar, Oct 15 2023

Keywords

Crossrefs

Programs

  • Mathematica
    seq[max_] := With[{ps = {2, 3, 5, 149, 10771}}, If[max <= Max[ps], f[p_, e_] := If[MemberQ[ps, p], 1, e + 1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, max], Print["Add to ps more terms from A366642"]]]; seq[10^6]

Formula

Multiplicative with a(p^e) = 1 if p is a term of A366642, and e+1 otherwise.
Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k)/A000005(k) = 1/2.
Dirichlet g.f.: zeta(s)^2 * Product_{p in A366642} (1 - 1/p^s).
Sum_{k=1..n} a(k) ~ c * n * log(n), where c = Product_{p in A366642} (1 - 1/p) = 0.26485234983834588444... .
Showing 1-9 of 9 results.