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

A333194 a(n) = Sum_{k=1..n} (ceiling(n/k) mod 2) * k.

Original entry on oeis.org

1, 2, 4, 4, 8, 8, 11, 11, 19, 16, 21, 21, 30, 30, 37, 29, 45, 45, 51, 51, 66, 56, 67, 67, 88, 83, 96, 84, 105, 105, 112, 112, 144, 130, 147, 135, 159, 159, 178, 162, 197, 197, 208, 208, 241, 209, 232, 232, 277, 270, 290, 270, 309, 309, 324, 308, 357, 335, 364, 364
Offset: 1

Views

Author

Ilya Gutkovskiy, May 25 2020

Keywords

Crossrefs

Programs

  • Maple
    b:= n-> add(d, d=select(x-> x::odd, numtheory[divisors](n))):
    a:= proc(n) option remember; n+`if`(n<2, 0, a(n-1))-b(n-1) end:
    seq(a(n), n=1..60);  # Alois P. Heinz, May 25 2020
  • Mathematica
    Table[Sum[Mod[Ceiling[n/k], 2] k, {k, 1, n}], {n, 1, 60}]
    Table[n (n + 1)/2 - Sum[DivisorSum[k, (-1)^(k/# + 1) # &], {k, 1, n - 1}], {n, 1, 60}]
    nmax = 60; CoefficientList[Series[x/(1 - x) (1/(1 - x)^2 - Sum[k x^k/(1 + x^k), {k, 1, nmax}]), {x, 0, nmax}], x] // Rest
  • PARI
    a(n) = sum(k=1, n, (ceil(n/k) % 2)*k); \\ Michel Marcus, May 26 2020

Formula

G.f.: (x/(1 - x)) * (1/(1 - x)^2 - Sum_{k>=1} k * x^k / (1 + x^k)).
a(n) = n*(n + 1)/2 - Sum_{k=1..n-1} A000593(k).
a(n) = A000217(n) - A078471(n-1).

A363341 Number of positive integers k <= n such that round(n/k) is odd.

Original entry on oeis.org

1, 1, 2, 2, 4, 3, 4, 4, 6, 7, 6, 5, 9, 8, 9, 9, 10, 10, 11, 12, 13, 12, 13, 12, 15, 16, 17, 16, 17, 16, 17, 17, 20, 21, 20, 20, 23, 22, 21, 22, 24, 23, 26, 25, 28, 27, 26, 25, 27, 29, 30, 31, 32, 31, 32, 31, 32, 33, 34, 33, 35, 34, 37, 37, 40, 39, 38, 39, 40
Offset: 1

Views

Author

Caleb M. Shor, May 28 2023

Keywords

Comments

Here round(x) = floor(x + 1/2).
a(n) is related to the number of lattice points in a circle. Let C(x) equal the number of square lattice points in a circle of radius sqrt(x) centered at the origin. Then a(n) = (C(2n) - 4n - 1)/4. (Prop 3.5 in Dent & Shor paper)

Examples

			For n=5: round(5/1), round(5/2), round(5/3), round(5/4), round(5/5) = 5, 3, 2, 1, 1 among which 4 are odd so a(5)=4.
		

Crossrefs

Cf. A059851 (number of k=1..n such that floor(n/k) is odd).
Cf. A330926 (number of k=1..n such that ceiling(n/k) is odd).
Cf. A057655 (number of lattice points in circle).
Cf. A001826 (d_1), A001842 (d_3), A002654 (d_1-d_3).
Cf. A077024 (n + floor(2n/3) + floor(2n/5) + floor(2n/7) + ...).

Programs

  • Maple
    f:= proc(n) local k;
       nops(select(k -> floor(n/k + 1/2)::odd, [$1..n]))
    end proc:
    map(f, [$1..120]); # Robert Israel, Aug 03 2025
  • PARI
    a(n) = sum(k=1, n, round(n/k)%2) \\ Andrew Howroyd, May 28 2023

Formula

a(n) = n - floor(2n/3) + floor(2n/5) - floor(2n/7) + ...
a(n) = -n + Sum_{k=1..2n} d_1(k) - d_3(k), where d_i(k) is the number of divisors of k that are congruent to i modulo 4.
Showing 1-2 of 2 results.