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-10 of 28 results. Next

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

A307704 Expansion of (1/(1 - x)) * Sum_{k>=1} (-x)^k/(1 - (-x)^k).

Original entry on oeis.org

-1, 1, -1, 2, 0, 4, 2, 6, 3, 7, 5, 11, 9, 13, 9, 14, 12, 18, 16, 22, 18, 22, 20, 28, 25, 29, 25, 31, 29, 37, 35, 41, 37, 41, 37, 46, 44, 48, 44, 52, 50, 58, 56, 62, 56, 60, 58, 68, 65, 71, 67, 73, 71, 79, 75, 83, 79, 83, 81, 93, 91, 95, 89, 96, 92, 100, 98, 104, 100, 108
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 22 2019

Keywords

Crossrefs

Cf. A001620 (gamma), A002162.

Programs

  • Mathematica
    nmax = 70; Rest[CoefficientList[Series[1/(1 - x) Sum[(-x)^k/(1 - (-x)^k), {k, 1, nmax}], {x, 0, nmax}], x]]
    Table[Sum[(-1)^k DivisorSigma[0, k], {k, 1, n}], {n, 1, 70}]
    Accumulate[Array[(-1)^#*DivisorSigma[0, #] &, 70]] (* Amiram Eldar, Oct 14 2022 *)

Formula

a(n) = Sum_{k=1..n} (-1)^k*A000005(k).
a(n) = n*log(n)/2 + (gamma - log(2) - 1/2)*n + O(n^(131/416 + eps)) (Tóth, 2017). - Amiram Eldar, Oct 14 2022

A268235 a(n) = Sum_{k=1..n} floor(n/k)*2^(k-1).

Original entry on oeis.org

1, 4, 9, 20, 37, 76, 141, 280, 541, 1072, 2097, 4192, 8289, 16548, 32953, 65860, 131397, 262764, 524909, 1049736, 2098381, 4196560, 8390865, 16781696, 33558929, 67117460, 134226585, 268452580, 536888037, 1073775900, 2147517725, 4295034280, 8590002605, 17180002736, 34359872001, 68719743792
Offset: 1

Views

Author

Benoit Cloitre and N. J. A. Sloane, Feb 05 2016

Keywords

Comments

This is the "floor transform" of the powers of 2.

Crossrefs

First differences give A034729.
Cf. A000079.
Sums of the form Sum_{k=1..n} q^(k-1)*floor(n/k): A344820 (q=-n), A344819 (q=-4), A344818 (q=-3), A344817 (q=-2), A059851 (q=-1), A006218 (q=1), this sequence (q=2), A344814 (q=3), A344815 (q=4), A344816 (q=5), A332533 (q=n).

Programs

  • Magma
    A268235:= func< n | (&+[Floor(n/j)*2^(j-1): j in [1..n]]) >;
    [A268235(n): n in [1..40]]; // G. C. Greubel, Jun 27 2024
    
  • Maple
    # floor transform of a sequence
    ft:=proc(a) local b,n,j,k; b:=[];
    for n from 1 to nops(a) do j:=add(a[k]*floor(n/k),k=1..n); b:=[op(b),j]; od;
    b; end:
    ft([seq(2^i,i=0..50)]);
  • Mathematica
    Table[Sum[Floor[n/k] 2^(k - 1), {k, n}], {n, 36}] (* Michael De Vlieger, Feb 12 2017 *)
  • PARI
    a(n) = sum(k=1, n, (n\k)*2^(k-1)); \\ Michel Marcus, Feb 11 2017
    
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, 2^(d-1))); \\ Seiichi Manyama, May 29 2021
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, x^k/(1-2*x^k))/(1-x)) \\ Seiichi Manyama, May 29 2021
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, 2^(k-1)*x^k/(1-x^k))/(1-x)) \\ Seiichi Manyama, May 29 2021
    
  • SageMath
    def A268235(n): return sum((n//j)*2^(j-1) for j in range(1,n+1))
    [A268235(n) for n in range(1,41)] # G. C. Greubel, Jun 27 2024

Formula

a(n) ~ 2^n. - Vaclav Kotesovec, May 28 2021
From Seiichi Manyama, May 29 2021: (Start)
a(n) = Sum_{k=1..n} Sum_{d|k} 2^(d-1).
G.f.: (1/(1 - x)) * Sum_{k>=1} x^k/(1 - 2*x^k).
G.f.: (1/(1 - x)) * Sum_{k>=1} 2^(k-1) * x^k/(1 - x^k). (End)
a(n) = Sum_{k=1..n} (2^floor(n/k) - 1). - Ridouane Oudra, Feb 03 2023

Extensions

Definition corrected by Matthew House, Feb 11 2017

A332533 a(n) = (1/n) * Sum_{k=1..n} floor(n/k) * n^k.

Original entry on oeis.org

1, 4, 15, 92, 790, 9384, 137326, 2397352, 48428487, 1111122360, 28531183329, 810554859732, 25239592620853, 854769763924104, 31278135039463245, 1229782938533709200, 51702516368332126932, 2314494592676172411516, 109912203092257573556274, 5518821052632117898282620
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 16 2020

Keywords

Crossrefs

Sums of the form Sum_{k=1..n} q^(k-1)*floor(n/k): A344820 (q=-n), A344819 (q=-4), A344818 (q=-3), A344817 (q=-2), A059851 (q=-1), A006218 (q=1), A268235 (q=2), A344814 (q=3), A344815 (q=4), A344816 (q=5), this sequence (q=n).

Programs

  • Magma
    A332533:= func< n | (&+[Floor(n/j)*n^(j-1): j in [1..n]]) >;
    [A332533(n): n in [1..40]]; // G. C. Greubel, Jun 27 2024
    
  • Maple
    seq(add(n^(k-1)*floor(n/k), k=1..n), n=1..60); # Ridouane Oudra, Mar 05 2023
  • Mathematica
    Table[(1/n) Sum[Floor[n/k] n^k, {k, 1, n}], {n, 1, 20}]
    Table[(1/n) Sum[Sum[n^d, {d, Divisors[k]}], {k, 1, n}], {n, 1, 20}]
    Table[SeriesCoefficient[(1/(1 - x)) Sum[x^k/(1 - n x^k), {k, 1, n}], {x, 0, n}], {n, 1, 20}]
  • PARI
    a(n) = sum(k=1, n, (n\k)*n^k)/n; \\ Michel Marcus, Feb 16 2020
    
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, n^(d-1))); \\ Seiichi Manyama, May 29 2021
    
  • SageMath
    def A332533(n): return sum((n//j)*n^(j-1) for j in range(1,n+1))
    [A332533(n) for n in range(1,41)] # G. C. Greubel, Jun 27 2024

Formula

a(n) = [x^n] (1/(1 - x)) * Sum_{k>=1} x^k / (1 - n*x^k).
a(n) = (1/n) * Sum_{k=1..n} Sum_{d|k} n^d.
a(n) ~ n^(n-1). - Vaclav Kotesovec, May 28 2021
a(n) = (1/(n-1)) * Sum_{k=1..n} (n^floor(n/k) - 1), for n>=2. - Ridouane Oudra, Mar 05 2023

A344814 a(n) = Sum_{k=1..n} floor(n/k) * 3^(k-1).

Original entry on oeis.org

1, 5, 15, 46, 128, 384, 1114, 3332, 9903, 29671, 88721, 266151, 797593, 2392649, 7175709, 21526834, 64573556, 193720536, 581141026, 1743422288, 5230207428, 15690619684, 47071679294, 141215037738, 423644574301, 1270933715189, 3812799550089, 11438398630159
Offset: 1

Views

Author

Seiichi Manyama, May 29 2021

Keywords

Comments

Partial sums of A034730.

Crossrefs

Programs

  • Magma
    A344814:= func< n | (&+[Floor(n/k)*3^(k-1): k in [1..n]]) >;
    [A344814(n): n in [1..40]]; // G. C. Greubel, Jun 26 2024
    
  • Maple
    seq(add(3^(k-1)*floor(n/k), k=1..n), n=1..60); # Ridouane Oudra, Feb 05 2023
  • Mathematica
    a[n_] := Sum[3^(k - 1) * Quotient[n, k], {k, 1, n}]; Array[a, 30] (* Amiram Eldar, May 29 2021 *)
  • PARI
    a(n) = sum(k=1, n, n\k*3^(k-1));
    
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, 3^(d-1)));
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, x^k/(1-3*x^k))/(1-x))
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, 3^(k-1)*x^k/(1-x^k))/(1-x))
    
  • SageMath
    def A344814(n): return sum((n//k)*3^(k-1) for k in range(1,n+1))
    [A344814(n) for n in range(1,41)] # G. C. Greubel, Jun 26 2024

Formula

a(n) = Sum_{k=1..n} Sum_{d|k} 3^(d-1).
G.f.: (1/(1 - x)) * Sum_{k>=1} x^k/(1 - 3*x^k).
G.f.: (1/(1 - x)) * Sum_{k>=1} 3^(k-1) * x^k/(1 - x^k).
a(n) ~ 3^n / 2. - Vaclav Kotesovec, Jun 05 2021
a(n) = (1/2) * Sum_{k=1..n} (3^floor(n/k) - 1). - Ridouane Oudra, Feb 05 2023

A344815 a(n) = Sum_{k=1..n} floor(n/k) * 4^(k-1).

Original entry on oeis.org

1, 6, 23, 92, 349, 1394, 5491, 21944, 87497, 349902, 1398479, 5593892, 22371109, 89484074, 357919803, 1431678080, 5726645377, 22906581142, 91626057879, 366504227292, 1466015859181, 5864063418866, 23456249463283, 93824997852744, 375299974563657, 1501199898183502
Offset: 1

Views

Author

Seiichi Manyama, May 29 2021

Keywords

Comments

Partial sums of A339684.

Crossrefs

Column k=4 of A344821.
Sums of the form Sum_{k=1..n} q^(k-1)*floor(n/k): A344820 (q=-n), A344819 (q=-4), A344818 (q=-3), A344817 (q=-2), A059851 (q=-1), A006218 (q=1), A268235 (q=2), A344814 (q=3), this sequence (q=4), A344816 (q=5), A332533 (q=n).

Programs

  • Magma
    A344815:= func< n | (&+[Floor(n/j)*4^(j-1): j in [1..n]]) >;
    [A344815(n): n in [1..40]]; // G. C. Greubel, Jun 27 2024
    
  • Maple
    seq(add(4^(k-1)*floor(n/k), k=1..n), n=1..60); # Ridouane Oudra, Feb 16 2023
  • Mathematica
    a[n_] := Sum[4^(k - 1) * Quotient[n, k], {k, 1, n}]; Array[a, 30] (* Amiram Eldar, May 29 2021 *)
  • PARI
    a(n) = sum(k=1, n, n\k*4^(k-1));
    
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, 4^(d-1)));
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, x^k/(1-4*x^k))/(1-x))
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, 4^(k-1)*x^k/(1-x^k))/(1-x))
    
  • SageMath
    def A344815(n): return sum((n//j)*4^(j-1) for j in range(1,n+1))
    [A344815(n) for n in range(1,41)] # G. C. Greubel, Jun 27 2024

Formula

a(n) = Sum_{k=1..n} Sum_{d|k} 4^(d-1).
G.f.: (1/(1 - x)) * Sum_{k>=1} x^k/(1 - 4*x^k).
G.f.: (1/(1 - x)) * Sum_{k>=1} 4^(k-1) * x^k/(1 - x^k).
a(n) ~ 4^n / 3. - Vaclav Kotesovec, Jun 05 2021
a(n) = (1/3) * Sum_{k=1..n} (4^floor(n/k) - 1). - Ridouane Oudra, Feb 16 2023

A344816 a(n) = Sum_{k=1..n} floor(n/k) * 5^(k-1).

Original entry on oeis.org

1, 7, 33, 164, 790, 3946, 19572, 97828, 488479, 2442235, 12207861, 61039267, 305179893, 1525898649, 7629414925, 38147071306, 190734961932, 953674808838, 4768372074464, 23841860356470, 119209292012746, 596046459981502, 2980232250997128, 14901161254984784
Offset: 1

Views

Author

Seiichi Manyama, May 29 2021

Keywords

Comments

Partial sums of A339685.

Crossrefs

Column k=5 of A344821.
Sums of the form Sum_{k=1..n} q^(k-1)*floor(n/k): A344820 (q=-n), A344819 (q=-4), A344818 (q=-3), A344817 (q=-2), A059851 (q=-1), A006218 (q=1), A268235 (q=2), A344814 (q=3), A344815 (q=4), this sequence (q=5), A332533 (q=n).

Programs

  • Magma
    A344816:= func< n | (&+[Floor(n/k)*5^(k-1): k in [1..n]]) >;
    [A344816(n): n in [1..40]]; // G. C. Greubel, Jun 26 2024
    
  • Maple
    seq(add(5^(k-1)*floor(n/k), k=1..n), n=1..60); # Ridouane Oudra, Mar 05 2023
  • Mathematica
    a[n_] := Sum[5^(k - 1) * Quotient[n, k], {k, 1, n}]; Array[a, 30] (* Amiram Eldar, May 29 2021 *)
  • PARI
    a(n) = sum(k=1, n, n\k*5^(k-1));
    
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, 5^(d-1)));
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, x^k/(1-5*x^k))/(1-x))
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, 5^(k-1)*x^k/(1-x^k))/(1-x))
    
  • SageMath
    def A344816(n): return sum((n//k)*5^(k-1) for k in range(1,n+1))
    [A344816(n) for n in range(1,41)] # G. C. Greubel, Jun 26 2024

Formula

a(n) = Sum_{k=1..n} Sum_{d|k} 5^(d-1).
G.f.: (1/(1 - x)) * Sum_{k>=1} x^k/(1 - 5*x^k).
G.f.: (1/(1 - x)) * Sum_{k>=1} 5^(k-1) * x^k/(1 - x^k).
a(n) ~ 5^n / 4. - Vaclav Kotesovec, Jun 05 2021
a(n) = (1/4) * Sum_{k=1..n} (5^floor(n/k) - 1). - Ridouane Oudra, Mar 05 2023

A344817 a(n) = Sum_{k=1..n} floor(n/k) * (-2)^(k-1).

Original entry on oeis.org

1, 0, 5, -4, 13, -16, 49, -88, 173, -324, 701, -1384, 2713, -5416, 10989, -21916, 43621, -87224, 174921, -349872, 698773, -1397356, 2796949, -5593872, 11183361, -22366976, 44742149, -89483716, 178951741, -357903312, 715838513, -1431678040, 2863290285
Offset: 1

Views

Author

Seiichi Manyama, May 29 2021

Keywords

Crossrefs

Column k=2 of A344824.
Cf. A081295.
Sums of the form Sum_{k=1..n} q^(k-1)*floor(n/k): A344820 (q=-n), A344819 (q=-4), A344818 (q=-3), this sequence (q=-2), A059851 (q=-1), A006218 (q=1), A268235 (q=2), A344814 (q=3), A344815 (q=4), A344816 (q=5), A332533 (q=n).

Programs

  • Magma
    A344817:= func< n | (&+[Floor(n/k)*(-2)^(k-1): k in [1..n]]) >;
    [A344817(n): n in [1..40]]; // G. C. Greubel, Jun 26 2024
    
  • Mathematica
    a[n_] := Sum[(-2)^(k - 1) * Quotient[n, k], {k, 1, n}]; Array[a, 30] (* Amiram Eldar, May 29 2021 *)
  • PARI
    a(n) = sum(k=1, n, n\k*(-2)^(k-1));
    
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, (-2)^(d-1)));
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, x^k/(1+2*x^k))/(1-x))
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, (-2)^(k-1)*x^k/(1-x^k))/(1-x))
    
  • SageMath
    def A344817(n): return sum((n//k)*(-2)^(k-1) for k in range(1,n+1))
    [A344817(n) for n in range(1,41)] # G. C. Greubel, Jun 26 2024

Formula

a(n) = Sum_{k=1..n} Sum_{d|k} (-2)^(d-1).
G.f.: (1/(1 - x)) * Sum_{k>=1} x^k/(1 + 2*x^k).
G.f.: (1/(1 - x)) * Sum_{k>=1} (-2)^(k-1) * x^k/(1 - x^k).
a(n) ~ -(-1)^n * 2^n / 3. - Vaclav Kotesovec, Jun 05 2021

A344820 a(n) = Sum_{k=1..n} floor(n/k) * (-n)^(k-1).

Original entry on oeis.org

1, 0, 9, -52, 520, -6636, 102984, -1864600, 38741463, -909081740, 23775986069, -685854111804, 21633935838489, -740800448012044, 27368368159530285, -1085102592823737200, 45957792326631241516, -2070863582899905915336, 98920982783031811482920, -4993219047619535240997780
Offset: 1

Views

Author

Seiichi Manyama, May 29 2021

Keywords

Crossrefs

Diagonal of A344824.
Sums of the form Sum_{k=1..n} q^(k-1)*floor(n/k): this sequence (q=-n), A344819 (q=-4), A344818 (q=-3), A344817 (q=-2), A059851 (q=-1), A006218 (q=1), A268235 (q=2), A344814 (q=3), A344815 (q=4), A344816 (q=5), A332533 (q=n).

Programs

  • Magma
    A344820:= func< n | (&+[Floor(n/k)*(-n)^(k-1): k in [1..n]]) >;
    [A344820(n): n in [1..40]]; // G. C. Greubel, Jun 26 2024
    
  • Mathematica
    a[n_] := Sum[(-n)^(k - 1) * Quotient[n, k], {k, 1, n}]; Array[a, 20] (* Amiram Eldar, May 29 2021 *)
  • PARI
    a(n) = sum(k=1, n, n\k*(-n)^(k-1));
    
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, (-n)^(d-1)));
    
  • SageMath
    def A344820(n): return sum((n//k)*(-n)^(k-1) for k in range(1,n+1))
    [A344820(n) for n in range(1,41)] # G. C. Greubel, Jun 26 2024

Formula

a(n) = Sum_{k=1..n} Sum_{d|k} (-n)^(d-1).
a(n) = [x^n] (1/(1 - x)) * Sum_{k>=1} x^k/(1 + n*x^k).
a(n) = [x^n] (1/(1 - x)) * Sum_{k>=1} (-n)^(k-1) * x^k/(1 - x^k).
a(n) ~ -(-1)^n * n^(n-1). - Vaclav Kotesovec, Jun 05 2021

A344818 a(n) = Sum_{k=1..n} floor(n/k) * (-3)^(k-1).

Original entry on oeis.org

1, -1, 9, -20, 62, -174, 556, -1660, 4911, -14693, 44357, -133053, 398389, -1195207, 3587853, -10763270, 32283452, -96850386, 290570104, -871710994, 2615074146, -7845220010, 23535839600, -70607518824, 211822017739, -635466060265, 1906399774635, -5719199303975
Offset: 1

Views

Author

Seiichi Manyama, May 29 2021

Keywords

Crossrefs

Column k=3 of A344824.
Cf. A101561.
Sums of the form Sum_{k=1..n} q^(k-1)*floor(n/k): A344820 (q=-n), A344819 (q=-4), this sequence (q=-3), A344817 (q=-2), A059851 (q=-1), A006218 (q=1), A268235 (q=2), A344814 (q=3), A344815 (q=4), A344816 (q=5), A332533 (q=n).

Programs

  • Magma
    A344818:= func< n | (&+[Floor(n/k)*(-3)^(k-1): k in [1..n]]) >;
    [A344818(n): n in [1..40]]; // G. C. Greubel, Jun 26 2024
    
  • Mathematica
    a[n_] := Sum[(-3)^(k - 1) * Quotient[n, k], {k, 1, n}]; Array[a, 30] (* Amiram Eldar, May 29 2021 *)
  • PARI
    a(n) = sum(k=1, n, n\k*(-3)^(k-1));
    
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, (-3)^(d-1)));
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, x^k/(1+3*x^k))/(1-x))
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, (-3)^(k-1)*x^k/(1-x^k))/(1-x))
    
  • SageMath
    def A344818(n): return sum((n//k)*(-3)^(k-1) for k in range(1,n+1))
    [A344818(n) for n in range(1,41)] # G. C. Greubel, Jun 26 2024

Formula

a(n) = Sum_{k=1..n} Sum_{d|k} (-3)^(d-1).
G.f.: (1/(1 - x)) * Sum_{k>=1} x^k/(1 + 3*x^k).
G.f.: (1/(1 - x)) * Sum_{k>=1} (-3)^(k-1) * x^k/(1 - x^k).
a(n) ~ -(-1)^n * 3^n / 4. - Vaclav Kotesovec, Jun 05 2021
Showing 1-10 of 28 results. Next