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.

Previous Showing 11-20 of 28 results. Next

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

Original entry on oeis.org

1, -2, 15, -52, 205, -806, 3291, -13160, 52393, -209498, 839079, -3356300, 13420917, -53683854, 214751875, -859006400, 3435960897, -13743843762, 54975632975, -219902535924, 879609095965, -3518436366566, 14073749677851, -56294998711576, 225179977999337, -900719912066074
Offset: 1

Views

Author

Seiichi Manyama, May 29 2021

Keywords

Crossrefs

Programs

  • Magma
    A344819:= func< n | (&+[(-4)^(k-1)*Floor(n/k): k in [1..n]]) >;
    [A344819(n): n in [1..40]]; // G. C. Greubel, Jun 25 2024
    
  • 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 A344819(n): return sum((-4)^(k-1)*int(n//k) for k in range(1,n+1))
    [A344819(n) for n in range(1,41)] # G. C. Greubel, Jun 25 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) ~ -(-1)^n * 4^n / 5. - Vaclav Kotesovec, Jun 05 2021

A014200 Number of solutions to x^2 + y^2 <= n, excluding (0,0), divided by 4.

Original entry on oeis.org

0, 1, 2, 2, 3, 5, 5, 5, 6, 7, 9, 9, 9, 11, 11, 11, 12, 14, 15, 15, 17, 17, 17, 17, 17, 20, 22, 22, 22, 24, 24, 24, 25, 25, 27, 27, 28, 30, 30, 30, 32, 34, 34, 34, 34, 36, 36, 36, 36, 37, 40, 40, 42, 44, 44, 44, 44, 44, 46
Offset: 0

Views

Author

Keywords

Comments

From Ant King, Mar 15 2013: (Start)
The terms of this sequence give a running total of the excess of the 4k + 1 divisors of the natural numbers (from 1 through to n) over their 4k + 3 divisors.
To see how good the approximation n * Pi/4 is to a(n), note that a(10^6) = 785387 whereas 10^6 * Pi/4 rounds to 785398. (End)

Crossrefs

Partial sums of A002654.

Programs

  • Mathematica
    1/4*Prepend[SquaresR[2,#]&/@Range[58],0]//Accumulate (* Ant King, Mar 15 2013 *)
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, kronecker(-4, k/d))); \\ Seiichi Manyama, Dec 18 2021

Formula

a(n) = A014198(n) / 4.
Limit_{n->infinity} a(n)/n = Pi/4 = A003881.
a(n) = n - floor(n/3) + floor(n/5) - floor(n/7) + floor(n/9) - floor(n/11) + ... - Yuval Dekel (dekelyuval(AT)hotmail.com), Aug 28 2003
G.f.: (1/(1 - x))*Sum_{k>=1} x^k/(1 + x^(2*k)). - Ilya Gutkovskiy, Dec 23 2016

A344726 Square array T(n,k), n >= 1, k >= 1, read by antidiagonals downwards, where T(n,k) = Sum_{j=1..n} (-1)^(j+1) * floor(n/j)^k.

Original entry on oeis.org

1, 1, 1, 1, 3, 3, 1, 7, 9, 2, 1, 15, 27, 12, 4, 1, 31, 81, 56, 22, 4, 1, 63, 243, 240, 118, 30, 6, 1, 127, 729, 992, 610, 196, 44, 4, 1, 255, 2187, 4032, 3094, 1230, 324, 48, 7, 1, 511, 6561, 16256, 15562, 7564, 2336, 448, 71, 7, 1, 1023, 19683, 65280, 77998, 45990, 16596, 3840, 685, 83, 9
Offset: 1

Views

Author

Seiichi Manyama, May 27 2021

Keywords

Examples

			Square array begins:
  1,  1,   1,    1,    1,     1, ...
  1,  3,   7,   15,   31,    63, ...
  3,  9,  27,   81,  243,   729, ...
  2, 12,  56,  240,  992,  4032, ...
  4, 22, 118,  610, 3094, 15562, ...
  4, 30, 196, 1230, 7564, 45990, ...
		

Crossrefs

Columns k=1..5 give A059851, A344720, A344721, A344722, A344723.
T(n,n) gives A344724.
Cf. A344725.

Programs

  • Mathematica
    T[n_, k_] := Sum[(-1)^(j + 1) * Quotient[n, j]^k, {j, 1, n}]; Table[T[k, n - k + 1], {n, 1, 11}, {k, 1, n}] // Flatten (* Amiram Eldar, May 27 2021 *)
  • PARI
    T(n, k) = sum(j=1, n, (-1)^(j+1)*(n\j)^k);
    
  • PARI
    T(n, k) = sum(j=1, n, sumdiv(j, d, (-1)^(j/d+1)*(d^k-(d-1)^k)));

Formula

G.f. of column k: (1/(1 - x)) * Sum_{j>=1} (j^k - (j - 1)^k) * x^j/(1 + x^j).
T(n,k) = Sum_{j=1..n} Sum_{d|j} (-1)^(j/d + 1) * (d^k - (d - 1)^k).

A344824 Square array A(n,k), n >= 1, k >= 0, read by antidiagonals downwards, where A(n,k) = Sum_{j=1..n} floor(n/j) * (-k)^(j-1).

Original entry on oeis.org

1, 1, 2, 1, 1, 3, 1, 0, 3, 4, 1, -1, 5, 2, 5, 1, -2, 9, -4, 4, 6, 1, -3, 15, -20, 13, 4, 7, 1, -4, 23, -52, 62, -16, 6, 8, 1, -5, 33, -106, 205, -174, 49, 4, 9, 1, -6, 45, -188, 520, -806, 556, -88, 7, 10, 1, -7, 59, -304, 1109, -2584, 3291, -1660, 173, 7, 11
Offset: 1

Views

Author

Seiichi Manyama, May 29 2021

Keywords

Examples

			Square array, A(n, k), begins:
  1, 1,   1,    1,    1,     1,     1, ...
  2, 1,   0,   -1,   -2,    -3,    -4, ...
  3, 3,   5,    9,   15,    23,    33, ...
  4, 2,  -4,  -20,  -52,  -106,  -188, ...
  5, 4,  13,   62,  205,   520,  1109, ...
  6, 4, -16, -174, -806, -2584, -6636, ...
Antidiagonal triangle, T(n, k), begins:
  1;
  1,  2;
  1,  1,   3;
  1,  0,   3,    4;
  1, -1,   5,    2,   5;
  1, -2,   9,   -4,   4,    6;
  1, -3,  15,  -20,  13,    4,   7;
  1, -4,  23,  -52,  62,  -16,   6,   8;
  1, -5,  33, -106, 205, -174,  49,   4,  9;
  1, -6,  45, -188, 520, -806, 556, -88,  7,  10;
		

Crossrefs

Columns k=0..4 give A000027, A059851, A344817, A344818, A344819.
A(n,n) gives A344820.
Cf. A344821.

Programs

  • Magma
    A:= func< n,k | k eq n select n else (&+[Floor(n/j)*(-k)^(j-1): j in [1..n]]) >;
    A344824:= func< n,k | A(k+1, n-k-1) >;
    [A344824(n,k): k in [0..n-1], n in [1..12]]; // G. C. Greubel, Jun 27 2024
    
  • Mathematica
    A[n_, k_] := Sum[If[k == 0 && j == 1, 1, (-k)^(j - 1)] * Quotient[n, j], {j, 1, n}]; Table[A[k, n - k], {n, 1, 10}, {k, 1, n}] // Flatten (* Amiram Eldar, May 29 2021 *)
  • PARI
    A(n, k) = sum(j=1, n, n\j*(-k)^(j-1));
    
  • PARI
    A(n, k) = sum(j=1, n, sumdiv(j, d, (-k)^(d-1)));
    
  • SageMath
    def A(n,k): return n if k==n else sum((n//j)*(-k)^(j-1) for j in range(1,n+1))
    def A344824(n,k): return A(k+1, n-k-1)
    flatten([[A344824(n,k) for k in range(n)] for n in range(1,13)]) # G. C. Greubel, Jun 27 2024

Formula

G.f. of column k: (1/(1 - x)) * Sum_{j>=1} x^j/(1 + k*x^j).
G.f. of column k: (1/(1 - x)) * Sum_{j>=1} (-k)^(j-1) * x^j/(1 - x^j).
A(n,k) = Sum_{j=1..n} Sum_{d|j} (-k)^(d - 1).
T(n, k) = Sum_{j=1..(k+1)} floor((k+1)/j) * (k-n+1)^(j-1), for n >= 1, 0 <= k <= n-1 (antidiagonal triangle). - G. C. Greubel, Jun 27 2024

A075997 a(n) = [n/2] - [n/3] + [n/4] - [n/5] + [n/6] - ..., where [n/k] = floor(n/k).

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 2, 1, 4, 2, 3, 2, 5, 4, 5, 2, 6, 5, 6, 5, 8, 5, 6, 5, 10, 8, 9, 6, 9, 8, 9, 8, 13, 10, 11, 8, 12, 11, 12, 9, 14, 13, 14, 13, 16, 11, 12, 11, 18, 16, 17, 14, 17, 16, 17, 14, 19, 16, 17, 16, 21, 20, 21, 16, 22, 19, 20, 19, 22, 19, 20, 19, 26, 25, 26, 21, 24, 21, 22, 21
Offset: 0

Views

Author

Clark Kimberling, Sep 28 2002

Keywords

Comments

a(n) is the number of terms among {floor(n/k)}, 1<=k<=n, which are even. - Leroy Quet, Jan 19 2006

Examples

			a(6) = [6/2]-[6/3]+[6/4]-[6/5]+[6/6]-[6/7]+... = 3-2+1-1+1-0+... = 2.
		

Crossrefs

Programs

  • Maple
    A075997:=n->add(floor(n/(2*i))-floor((n-i)/(2*i)), i=1..n): seq(A075997(n), n=0..100); # Wesley Ivan Hurt, Jan 30 2016
  • Mathematica
    Table[Sum[Floor[n/(2 i)] - Floor[(n - i)/(2 i)], {i, n}], {n, 0, 100}] (* Wesley Ivan Hurt, Jan 30 2016 *)
  • PARI
    a(n) = sum(k=2, n, (-1)^k*(n\k)); \\ Michel Marcus, Dec 20 2020
    
  • Python
    from math import isqrt
    def A075997(n): return n+(s:=isqrt(n))**2-((t:=isqrt(m:=n>>1))**2<<1)-(sum(n//k for k in range(1,s+1))-(sum(m//k for k in range(1,t+1))<<1)<<1) # Chai Wah Wu, Oct 23 2023

Formula

a(n) = n - A059851(n).
a(n) = n - A006218(n) + 2*A006218(floor(n/2)). - Vladeta Jovovic, Oct 02 2002
a(n) = n - Sum_{n/2A000005(k). - Leroy Quet, Jan 19 2006
G.f.: ( Sum_{i>0} x^(2*i)/(1+x^i) )/(1-x). - Vladeta Jovovic, Apr 24 2006
a(n) = Sum_{i=1..n} floor(n/(2*i)) - floor((n-i)/(2*i)). - Wesley Ivan Hurt, Jan 30 2016
Conjecture: Let f(a,b)=1, if (a+b) mod |a-b| != (a mod |a-b|)+(b mod |a-b|), and 0 otherwise. a(n) = Sum_{k=1..n-1} f(n+k,n-k). - Benedict W. J. Irwin, Sep 23 2016
a(n) = Sum_{k=1..n} (floor((n-i)/i) mod 2 ). - Wesley Ivan Hurt, Dec 20 2020
a(n) ~ (1 - log(2))*n. - Vaclav Kotesovec, Jun 14 2025

A275495 a(n) = Sum_{k=2..n} floor(n/k) - 2*floor(n/(2*k)).

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 5, 4, 6, 7, 8, 7, 8, 9, 12, 10, 11, 12, 13, 12, 15, 16, 17, 14, 16, 17, 20, 19, 20, 21, 22, 19, 22, 23, 26, 24, 25, 26, 29, 26, 27, 28, 29, 28, 33, 34, 35, 30, 32, 33, 36, 35, 36, 37, 40, 37, 40, 41, 42, 39, 40, 41, 46, 42, 45, 46, 47, 46, 49
Offset: 1

Views

Author

Peter Luschny, Jul 30 2016

Keywords

Crossrefs

Cf. A002541, row sums of A275510, A059851.

Programs

  • Maple
    seq(add(floor(n/k)-2*floor(n/(2*k)), k=2..n), n=1..60); # Ridouane Oudra, Oct 20 2019
  • Mathematica
    Table[Sum[Floor[n/k] - 2*Floor[n/(2*k)], {k, 2, n}], {n, 1, 50}] (* G. C. Greubel, Jul 30 2016 *)
  • PARI
    a(n)=sum(k=2,n,n\k) - 2*sum(k=2,n\2,n\(2*k)) \\ Charles R Greathouse IV, Jul 30 2016
  • Sage
    [sum([floor(n/k) - 2*floor(n/(2*k)) for k in (2..n)]) for n in (1..69)]
    

Formula

a(n) = Sum_{i=1..n} floor((n-i)/i)*(-1)^(i+1). - Wesley Ivan Hurt, Sep 13 2017
a(n) = Sum_{i=2..n} (floor(n/i) mod 2) = A059851(n) - (n mod 2). - Ridouane Oudra, Oct 20 2019
a(n) ~ log(2) * n. - Vaclav Kotesovec, May 28 2021

A309081 a(n) = n - floor(n/2^2) + floor(n/3^2) - floor(n/4^2) + ...

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 6, 6, 8, 9, 10, 10, 11, 12, 13, 12, 13, 15, 16, 16, 17, 18, 19, 19, 21, 22, 24, 24, 25, 26, 27, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 37, 38, 39, 38, 40, 42, 43, 43, 44, 46, 47, 47, 48, 49, 50, 50, 51, 52, 54, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 62
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 11 2019

Keywords

Crossrefs

Programs

  • Magma
    [1] cat [m-&+[(-1)^(k)*Floor(m/k^2):k in [2..m] ]:m in [2..75]]; // Marius A. Burtea, Jul 12 2019
    
  • Maple
    N:= 100: # for a(1)..a(N)
    V:= Vector([$1..N]):
    for k from 2 to floor(sqrt(N)) do
      for j from 1 to N/k^2 do
        t:=min((j+1)*k^2-1,N);
        V[j*k^2..t]:= V[j*k^2..t] +~ (-1)^(k+1)*j
    od od:
    convert(V,list); # Robert Israel, Jul 12 2019
  • Mathematica
    Table[Sum[(-1)^(k + 1) Floor[n/k^2], {k, 1, n}], {n, 1, 75}]
    nmax = 75; CoefficientList[Series[1/(1 - x) Sum[(-1)^(k + 1) x^(k^2)/(1 - x^(k^2)), {k, 1, Floor[nmax^(1/2)] + 1}], {x, 0, nmax}], x] // Rest
    Table[Sum[Boole[IntegerQ[d^(1/2)] && OddQ[d]], {d, Divisors[n]}] - Sum[Boole[IntegerQ[d^(1/2)] && EvenQ[d]], {d, Divisors[n]}], {n, 1, 75}] // Accumulate
  • Python
    from math import isqrt
    def A309081(n): return n+sum((1 if k%2 else -1)*(n//k**2) for k in range(2,isqrt(n)+1)) # Chai Wah Wu, Dec 20 2021

Formula

G.f.: (1/(1 - x)) * Sum_{k>=1} (-1)^(k+1) * x^(k^2)/(1 - x^(k^2)).
a(n) ~ Pi^2*n/12. - Vaclav Kotesovec, Oct 12 2019

A309082 a(n) = n - floor(n/2^3) + floor(n/3^3) - floor(n/4^3) + ...

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 25, 26, 27, 28, 29, 29, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 48, 50, 51, 51, 52, 53, 54, 55, 56, 57, 58, 57, 58, 59, 60, 61, 62, 63, 64, 64, 65, 66, 67
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 11 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[(-1)^(k + 1) Floor[n/k^3], {k, 1, n}], {n, 1, 75}]
    nmax = 75; CoefficientList[Series[1/(1 - x) Sum[(-1)^(k + 1) x^(k^3)/(1 - x^(k^3)), {k, 1, Floor[nmax^(1/3)] + 1}], {x, 0, nmax}], x] // Rest
    Table[Sum[Boole[IntegerQ[d^(1/3)] && OddQ[d]], {d, Divisors[n]}] - Sum[Boole[IntegerQ[d^(1/3)] && EvenQ[d]], {d, Divisors[n]}], {n, 1, 75}] // Accumulate

Formula

G.f.: (1/(1 - x)) * Sum_{k>=1} (-1)^(k+1) * x^(k^3)/(1 - x^(k^3)).
a(n) ~ 3*zeta(3)*n/4. - Vaclav Kotesovec, Oct 12 2019

A309083 a(n) = n - floor(n/2^4) + floor(n/3^4) - floor(n/4^4) + ...

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 11 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[(-1)^(k + 1) Floor[n/k^4], {k, 1, n}], {n, 1, 75}]
    nmax = 75; CoefficientList[Series[1/(1 - x) Sum[(-1)^(k + 1) x^(k^4)/(1 - x^(k^4)), {k, 1, Floor[nmax^(1/4)] + 1}], {x, 0, nmax}], x] // Rest
    Table[Sum[Boole[IntegerQ[d^(1/4)] && OddQ[d]], {d, Divisors[n]}] - Sum[Boole[IntegerQ[d^(1/4)] && EvenQ[d]], {d, Divisors[n]}], {n, 1, 75}] // Accumulate

Formula

G.f.: (1/(1 - x)) * Sum_{k>=1} (-1)^(k+1) * x^(k^4)/(1 - x^(k^4)).
a(n) ~ 7*zeta(4)*n/8 = 7*Pi^4*n/720. - Vaclav Kotesovec, Oct 12 2019

A332682 a(n) = Sum_{k=1..n} (-1)^(k+1) * ceiling(n/k).

Original entry on oeis.org

1, 1, 2, 3, 3, 4, 5, 6, 5, 7, 8, 9, 8, 9, 10, 13, 11, 12, 13, 14, 13, 16, 17, 18, 15, 17, 18, 21, 20, 21, 22, 23, 20, 23, 24, 27, 25, 26, 27, 30, 27, 28, 29, 30, 29, 34, 35, 36, 31, 33, 34, 37, 36, 37, 38, 41, 38, 41, 42, 43, 40, 41, 42, 47, 43, 46, 47, 48, 47, 50
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 19 2020

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local k; add((-1)^(k+1)*ceil(n/k),k=1..n) end proc:
    map(f, [$1..100]); # Robert Israel, Nov 25 2024
  • Mathematica
    Table[Sum[(-1)^(k + 1) Ceiling[n/k], {k, 1, n}], {n, 1, 70}]
    nmax = 70; CoefficientList[Series[(x/(1 - x)) (1 + Sum[x^k/(1 + x^k), {k, 2, nmax}]), {x, 0, nmax}], x] // Rest
  • PARI
    a(n) = sum(k=1, n, (-1)^(k+1)*ceil(n/k)); \\ Michel Marcus, Feb 21 2020

Formula

G.f.: (x/(1 - x)) * (1 + Sum_{k>=2} x^k / (1 + x^k)).
G.f.: (x/(1 - x)) * (1 + Sum_{k>=1} (-1)^(k+1) * x^(2*k) / (1 - x^k)).
a(n) = (n mod 2) + Sum_{k=1..n-1} A048272(k).
a(n) = 1 + Sum_{k<=n-1} A325937(k). - Robert Israel, Nov 25 2024
Previous Showing 11-20 of 28 results. Next