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

A069283 a(n) = -1 + number of odd divisors of n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Mar 13 2002

Keywords

Comments

Number of nontrivial ways to write n as sum of at least 2 consecutive integers. That is, we are not counting the trivial solution n=n. E.g., a(9)=2 because 9 = 4 + 5 and 9 = 2 + 3 + 4. a(8)=0 because there are no integers m and k such that m + (m+1) + ... + (m+k-1) = 8 apart from k=1, m=8. - Alfred Heiligenbrunner, Jun 07 2004
Also number of sums of sequences of consecutive positive integers excluding sequences of length 1 (e.g., 9 = 2+3+4 or 4+5 so a(9)=2). (Useful for cribbage players.) - Michael Gilleland, Dec 29 2002
Let M be any positive integer. Then a(n) = number of proper divisors of M^n + 1 of the form M^k + 1.
This sequence gives the distinct differences of triangular numbers Ti giving n : n = Ti - Tj; none if n = 2^k. If factor a = n or a > (n/a - 1)/2 : i = n/a + (a - 1)/2; j = n/a - (a+1)/2. Else : i = n/2a + (2a - 1)/2; j = n/2a - (2a - 1)/2. Examples: 7 is prime; 7 = T4 - T2 = (1 + 2 + 3 + 4) - (1 + 2) (a = 7; n/a = 1). The odd factors of 35 are 35, 7 and 5; 35 = T18 - T16 (a = 35) = T8 - T1 (a = 7) = T5 - T7 (a = 5). 144 = T20 - T11 (a = 9) = T49 - T46 (a = 3). - M. Dauchez (mdzzdm(AT)yahoo.fr), Oct 31 2005
Also number of partitions of n into the form 1 + 2 + ...( k - 1) + k + k + ... + k for some k >= 2. Example: a(9) = 2 because we have [2, 2, 2, 2, 1] and [3, 3, 2, 1]. - Emeric Deutsch, Mar 04 2006
a(n) is the number of nontrivial runsum representations of n, and is also known as the politeness of n. - Ant King, Nov 20 2010
Also number of nonpowers of 2 dividing n, divided by the number of powers of 2 dividing n, n > 0. - Omar E. Pol, Aug 24 2019
a(n) only depends on the prime signature of A000265(n). - David A. Corneth, May 30 2020, corrected by Charles R Greathouse IV, Oct 31 2021

Examples

			a(14) = 1 because the divisors of 14 are 1, 2, 7, 14, and of these, two are odd, 1 and 7, and -1 + 2 = 1.
a(15) = 3 because the divisors of 15 are 1, 3, 5, 15, and of these, all four are odd, and -1 + 4 = 3.
a(16) = 0 because 16 has only one odd divisor, and -1 + 1 = 0.
Using Ant King's formula: a(90) = 5 as 90 = 2^1 * 3^2 * 5^1, so a(90) = (1 + 2) * (1 + 1) - 1 = 5. - _Giovanni Ciriani_, Jan 12 2013
x^3 + x^5 + x^6 + x^7 + 2*x^9 + x^10 + x^11 + x^12 + x^13 + x^14 + ...
a(120) = 3 as the odd divisors of 120 are the odd divisors of 15 as 120 = 15*2^3. 15 has 4 odd divisors so that gives a(120) = 4 - 1 = 3. - _David A. Corneth_, May 30 2020
		

References

  • Ronald L. Graham, Donald E. Knuth and Oren Patashnik, Concrete Mathematics, 2nd ed., Addison-Wesley, 1994, see exercise 2.30 on p. 65.

Crossrefs

Cf. A095808 (sums of ascending and descending consecutive integers).

Programs

  • Haskell
    a069283 0 = 0
    a069283 n = length $ tail $ a182469_row n
    -- Reinhard Zumkeller, May 01 2012
    
  • Magma
    [0] cat [-1 + #[d:d in Divisors(n)| IsOdd(d)]:n in [1..100]]; // Marius A. Burtea, Aug 24 2019
    
  • Maple
    g:=sum(x^(k*(k+1)/2)/(1-x^k),k=2..20): gser:=series(g,x=0,115): seq(coeff(gser,x,n),n=0..100); # Emeric Deutsch, Mar 04 2006
    A069283 := proc(n)
        A001227(n)-1 ;
    end proc: # R. J. Mathar, Jun 18 2015
  • Mathematica
    g[n_] := Module[{dL = Divisors[2n], dP}, dP = Transpose[{dL, 2n/dL}]; Select[dP, ((1 < #[[1]] < #[[2]]) && (Mod[ #[[1]] - #[[2]], 2] == 1)) &] ]; Table[Length[g[n]], {n, 1, 100}]
    Table[Length[Select[Divisors[k], OddQ[#] &]] - 1, {k, 100}] (* Ant King, Nov 20 2010 *)
    Join[{0}, Times @@@ (#[[All, 2]] & /@ Replace[FactorInteger[Range[2, 50]], {2, a_} -> {2, 0}, Infinity] + 1) - 1] (* Horst H. Manninger, Oct 30 2021 *)
  • PARI
    {a(n) = if( n<1, 0, sumdiv( n, d, d%2) - 1)} /* Michael Somos, Aug 07 2013 */
    
  • PARI
    a(n) = numdiv(n >> valuation(n, 2)) - 1 \\ David A. Corneth, May 30 2020
    
  • Python
    from sympy import divisor_count
    def A069283(n): return divisor_count(n>>(~n&n-1).bit_length())-1 if n else 0 # Chai Wah Wu, Jul 16 2022

Formula

a(n) = 0 if and only if n = 2^k.
a(n) = A001227(n)-1.
a(n) = 1 if and only if n = 2^k * p where k >= 0 and p is an odd prime. - Ant King, Nov 20 2010
G.f.: sum(k>=2, x^(k(k + 1)/2)/(1 - x^k) ). - Emeric Deutsch, Mar 04 2006
If n = 2^k p1^b1 p2^b2 ... pr^br, then a(n) = (1 + b1)(1 + b2) ... (1 + br) - 1. - Ant King, Nov 20 2010
Dirichlet g.f.: (zeta(s)*(1-1/2^s) - 1)*zeta(s). - Geoffrey Critzer, Feb 15 2015
a(n) = (A000005(n) - A001511(n))/A001511(n) = A326987(n)/A001511(n), with n > 0 in both formulas. - Omar E. Pol, Aug 24 2019
G.f.: Sum_{k>=1} x^(3*k) / (1 - x^(2*k)). - Ilya Gutkovskiy, May 30 2020
From David A. Corneth, May 30 2020: (Start)
a(2*n) = a(n).
a(n) = A001227(A000265(n)) - 1. (End)
Sum_{k=1..n} a(k) ~ n*log(n)/2 + (gamma + log(2)/2 - 3/2)*n, where gamma is Euler's constant (A001620). - Amiram Eldar, Dec 01 2023

Extensions

Edited by Vladeta Jovovic, Mar 25 2002

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

A326989 Triangle read by rows in which row n lists the nonpowers of 2 dividing n, or 0 if n is a power of 2.

Original entry on oeis.org

0, 0, 3, 0, 5, 3, 6, 7, 0, 3, 9, 5, 10, 11, 3, 6, 12, 13, 7, 14, 3, 5, 15, 0, 17, 3, 6, 9, 18, 19, 5, 10, 20, 3, 7, 21, 11, 22, 23, 3, 6, 12, 24, 5, 25, 13, 26, 3, 9, 27, 7, 14, 28, 29, 3, 5, 6, 10, 15, 30, 31, 0, 3, 11, 33, 17, 34, 5, 7, 35, 3, 6, 9, 12, 18, 36, 37, 19, 38, 3, 13, 39, 5, 10, 20, 40, 41
Offset: 1

Views

Author

Omar E. Pol, Aug 24 2019

Keywords

Comments

Row n has length A326987(n) if n is not a power of 2, otherwise row n has length 1.

Examples

			Triangle begins:
   0;
   0;
   3;
   0;
   5;
   3,  6;
   7;
   0;
   3,  9;
   5, 10;
  11;
   3,  6, 12;
  13;
   7, 14;
   3,  5, 15;
   0;
  17;
   3,  6,  9, 18;
  ...
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 same as the 18th row of triangle.
		

Crossrefs

Row sums give A326988.

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

A327326 a(n) = A006218(n) - A005187(n).

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 4, 5, 5, 7, 9, 10, 13, 14, 16, 19, 19, 20, 24, 25, 28, 31, 33, 34, 38, 40, 42, 45, 48, 49, 55, 56, 56, 59, 61, 64, 70, 71, 73, 76, 80, 81, 87, 88, 91, 96, 98, 99, 104, 106, 110, 113, 116, 117, 123, 126, 130, 133, 135, 136, 145, 146, 148, 153, 153, 156, 162, 163, 166, 169, 175, 176, 184
Offset: 0

Views

Author

Omar E. Pol, Sep 14 2019

Keywords

Comments

Also, 0 together with the partial sums of A326987.

Crossrefs

Programs

  • Mathematica
    With[{nmax = 100}, Join[{0}, Accumulate[Table[DivisorSigma[0, n], {n, 1, nmax}]]] - Table[2*n - DigitCount[n, 2, 1], {n, 0, nmax}]] (* Amiram Eldar, Apr 18 2024 *)

Formula

a(n) ~ n * (log(n) + 2*gamma - 3), where gamma is Euler's constant (A001620). - Amiram Eldar, Apr 18 2024
Showing 1-5 of 5 results.