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.

A326987 Number of nonpowers of 2 dividing n.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 1, 0, 2, 2, 1, 3, 1, 2, 3, 0, 1, 4, 1, 3, 3, 2, 1, 4, 2, 2, 3, 3, 1, 6, 1, 0, 3, 2, 3, 6, 1, 2, 3, 4, 1, 6, 1, 3, 5, 2, 1, 5, 2, 4, 3, 3, 1, 6, 3, 4, 3, 2, 1, 9, 1, 2, 5, 0, 3, 6, 1, 3, 3, 6, 1, 8, 1, 2, 5, 3, 3, 6, 1, 5, 4, 2, 1, 9, 3, 2, 3, 4, 1, 10, 3, 3, 3, 2, 3, 6, 1, 4, 5, 6
Offset: 1

Views

Author

Omar E. Pol, Aug 18 2019

Keywords

Comments

In other words: a(n) is the number of divisors of n that are not powers of 2.
a(n) is also the number of odd divisors > 1 of n, multiplied by the number of divisors of n that are powers of 2.
a(n) = 0 iff n is a power of 2.
a(n) = 1 iff n is an odd prime.
From Bernard Schott, Sep 12 2019: (Start)
a(n) = 2 iff n is an even semiprime >= 6 or n is a square of prime >= 9 (Aug 26 2019).
a(n) = 3 iff n is an odd squarefree semiprime, or n is an odd prime multiplied by 4, or n is a cube of odd prime (End).

Examples

			For n = 18 the divisors of 18 are [1, 2, 3, 6, 9, 18]. There are four divisors of 18 that are not powers of 2, they are [3, 6, 9, 18], so a(18) = 4. On the other hand, there are two odd divisors > 1 of 18, they are [3, 9], and there are two divisors of 18 that are powers of 2, they are [1, 2], then we have that 2*2 = 4, so a(18) = 4.
		

Crossrefs

Programs

  • Magma
    sol:=[];  m:=1;  for n in [1..100] do v:=Set(Divisors(n)) diff {2^k:k in [0..Floor(Log(2,n))]};  sol[m]:=#v; m:=m+1; end for; sol; // Marius A. Burtea, Aug 24 2019
    
  • Maple
    a:= n-> numtheory[tau](n)-padic[ordp](2*n, 2):
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 24 2019
  • Mathematica
    a[n_] := DivisorSigma[0, n] - IntegerExponent[n, 2] - 1; Array[a, 100] (* Amiram Eldar, Aug 31 2019 *)
  • PARI
    ispp2(n) = (n==1) || (isprimepower(n, &p) && (p==2));
    a(n) = sumdiv(n, d, ispp2(d) == 0); \\ Michel Marcus, Aug 26 2019
    
  • Python
    from sympy import divisor_count
    def A326987(n): return divisor_count(n)-(n&-n).bit_length() # Chai Wah Wu, Jul 13 2022

Formula

a(n) = A000005(n) - A001511(n).
a(n) = (A001227(n) - 1)*A001511(n).
a(n) = A069283(n)*A001511(n).
Sum_{k=1..n} a(k) ~ n * (log(n) + 2*gamma - 3), where gamma is Euler's constant (A001620). - Amiram Eldar, Jan 18 2024

A326988 Sum of nonpowers of 2 dividing n.

Original entry on oeis.org

0, 0, 3, 0, 5, 9, 7, 0, 12, 15, 11, 21, 13, 21, 23, 0, 17, 36, 19, 35, 31, 33, 23, 45, 30, 39, 39, 49, 29, 69, 31, 0, 47, 51, 47, 84, 37, 57, 55, 75, 41, 93, 43, 77, 77, 69, 47, 93, 56, 90, 71, 91, 53, 117, 71, 105, 79, 87, 59, 161, 61, 93, 103, 0, 83, 141, 67, 119, 95, 141, 71, 180, 73, 111, 123, 133, 95, 165, 79, 155
Offset: 1

Views

Author

Omar E. Pol, Aug 18 2019

Keywords

Comments

In other words: a(n) is the sum of the divisors of n that are not powers of 2.
a(n) is also the sum of odd divisors greater than 1 of n, multiplied by the sum of the divisors of n that are powers of 2.
a(n) = 0 if and only if n is a power of 2.
a(n) = n if and only if n is an odd prime.
From Bernard Schott, Sep 17 2019: (Start)
a(n) = 3*n/2 if and only if n is an even semiprime greater than or equal to 6 (A100484).
a(n) = n + sqrt(n) if and only if n is the square of an odd prime (see A001248 without its first term). (End)

Examples

			For n = 18 the divisors of 18 are [1, 2, 3, 6, 9, 18]. There are four divisors of 18 that are not powers of 2, they are [3, 6, 9, 18]. The sum of them is 3 + 6 + 9 + 18 = 36, so a(18) = 36.
On the other hand, the sum of odd divisors greater than 1 of 18 is 3 + 9 = 12, and the sum of the divisors of 18 that are powers of 2 is 1 + 2 = 3, then we have that 12 * 3 = 36, so a(18) = 36.
		

Crossrefs

Row sums of A326989.

Programs

  • Magma
    sol:=[];  m:=1;  for n in [1..80] do v:=Set(Divisors(n)) diff {2^k:k in [0..Floor(Log(2,n))]};  sol[m]:=&+v; m:=m+1; end for; sol; // Marius A. Burtea, Aug 24 2019
    
  • Maple
    f:= n -> numtheory:-sigma(n) - 2^(1+padic:-ordp(n,2))+1:
    map(f, [$1..100]); # Robert Israel, Apr 29 2020
  • Mathematica
    Table[DivisorSigma[1, n] - Denominator[DivisorSigma[1, 2n]/DivisorSigma[1, n]], {n, 100}] (* Wesley Ivan Hurt, Aug 24 2019 *)
  • PARI
    ispp2(n) = (n==1) || (isprimepower(n, &p) && (p==2));
    a(n) = sumdiv(n, d, if (!ispp2(d), d)); \\ Michel Marcus, Aug 26 2019
    
  • Python
    from sympy import divisor_sigma
    def A326988(n): return divisor_sigma(n)-(n^(n-1)) # Chai Wah Wu, Aug 04 2022
  • Scala
    def divisors(n: Int): IndexedSeq[Int] = (1 to n).filter(n % _ == 0)
    (1 to 80).map(divisors().filter(n => n != Integer.highestOneBit(n)).sum) // _Alonso del Arte, Apr 29 2020
    

Formula

a(n) = A000203(n) - A038712(n).
a(n) = (A000593(n) - 1)*A038712(n).
a(n) = A326990(n)*A038712(n).
a(n) = Sum_{d|n, d > 1} d * (1 - [rad(d) = 2]), where rad is the squarefree kernel (A007947) and [] is the Iverson bracket, which gives 1 if the condition is true, 0 if it's false. - Wesley Ivan Hurt, Apr 29 2020

A326990 Sum of odd divisors of n that are greater than 1.

Original entry on oeis.org

0, 0, 3, 0, 5, 3, 7, 0, 12, 5, 11, 3, 13, 7, 23, 0, 17, 12, 19, 5, 31, 11, 23, 3, 30, 13, 39, 7, 29, 23, 31, 0, 47, 17, 47, 12, 37, 19, 55, 5, 41, 31, 43, 11, 77, 23, 47, 3, 56, 30, 71, 13, 53, 39, 71, 7, 79, 29, 59, 23, 61, 31, 103, 0, 83, 47, 67, 17, 95, 47, 71, 12, 73, 37, 123, 19, 95, 55, 79, 5
Offset: 1

Views

Author

Omar E. Pol, Aug 24 2019

Keywords

Comments

Also sum of nonpowers of 2 dividing n, divided the sum of powers of 2 dividing n.
a(n) = 0 iff n is a power of 2.
a(n) = n iff n is an odd prime.
First differs from A284233 at a(15).

Examples

			For n = 18 the divisors of 18 are [1, 2, 3, 6, 9, 18]. The sum of odd divisors of 18 that are greater than 1 is 3 + 9 = 12, so a(18) = 12. On the other hand, there are four divisors of 18 that are not powers of 2, they are [3, 6, 9, 18], and the sum of them is 3 + 6 + 9, 18 = 36. Also there are two divisors of 18 that are powers of 2, they are [1, 2], and the sum of them is 1 + 2 = 3. Then we have that 36/3 = 12, so a(18) = 12.
		

Crossrefs

Programs

  • Magma
    sol:=[]; m:=1; for n in [1..80] do v:=[d:d in Divisors(n)|d gt 1 and IsOdd(d)]; if #v ne 0 then sol[m]:=&+v; m:=m+1; else sol[m]:=0; m:=m+1; end if; end for; sol; // Marius A. Burtea, Aug 24 2019
  • Mathematica
    Table[Total[Select[Rest[Divisors[n]],OddQ]],{n,80}] (* Harvey P. Dale, Jan 11 2025 *)

Formula

a(n) = A000593(n) - 1.
a(n) = (A000203(n) - A038712(n))/A038712(n).
a(n) = A326988(n)/A038712(n).

A327328 a(n) is the smallest positive integer divisible by exactly n nonpowers of 2.

Original entry on oeis.org

1, 3, 6, 12, 18, 45, 30, 105, 72, 60, 90, 315, 120, 3645, 210, 180, 450, 1575, 480, 2835, 360, 420, 630, 3465, 900, 720, 7290, 1620, 840, 14175, 1440, 10395, 1800, 1260, 3150, 1680, 3240, 1937102445, 5670, 14580, 3600, 127575, 3360, 2066715, 2520, 3780, 6930
Offset: 0

Views

Author

Omar E. Pol, Sep 20 2019

Keywords

Comments

Terms are of the form A233819(m) * 2^k for some m > 0, k >= 0. - David A. Corneth, Nov 25 2019

Crossrefs

Programs

  • PARI
    ispp(x) = my(p); (x == 1) || (isprimepower(x, &p) && (p==2));
    nbdiv(k) = #select(x->(!ispp(x)), divisors(k));
    a(n) = my(k=1); while (nbdiv(k) != n, k++); k; \\ Michel Marcus, Nov 25 2019
    
  • PARI
    a(n) = for(i = 1, oo, if(numdiv(i) - valuation(i, 2) - 1 == n, return(i))) \\ David A. Corneth, Nov 25 2019

Extensions

a(13)-a(36), a(38)-a(46) from Jon E. Schoenfield, Nov 22 2019
a(37) from Jon E. Schoenfield and David A. Corneth, Nov 25 2019
Showing 1-4 of 4 results.