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

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

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 3, 2, 5, 3, 4, 3, 6, 5, 6, 3, 7, 6, 7, 6, 9, 6, 7, 6, 11, 9, 10, 7, 10, 9, 10, 9, 14, 11, 12, 9, 13, 12, 13, 10, 15, 14, 15, 14, 17, 12, 13, 12, 19, 17, 18, 15, 18, 17, 18, 15, 20, 17, 18, 17, 22, 21, 22, 17, 23, 20, 21, 20, 23, 20, 21, 20, 27, 26, 27, 22, 25, 22, 23, 22
Offset: 1

Views

Author

Ilya Gutkovskiy, May 25 2020

Keywords

Comments

a(n) = number of terms among {ceiling(n/k)}, 1 <= k <= n, that are odd.

Crossrefs

Programs

  • Maple
    b:= n-> add((-1)^d, d=numtheory[divisors](n)):
    a:= proc(n) option remember; `if`(n>0, 1+b(n-1)+a(n-1), 0) end:
    seq(a(n), n=1..80);  # Alois P. Heinz, May 25 2020
  • Mathematica
    Table[Sum[Mod[Ceiling[n/k], 2], {k, 1, n}], {n, 1, 80}]
    Table[n - Sum[DivisorSum[k, (-1)^(# + 1) &], {k, 1, n - 1}], {n, 1, 80}]
    nmax = 80; CoefficientList[Series[x/(1 - x) (1 + Sum[x^(2 k)/(1 + x^k), {k, 1, nmax}]), {x, 0, nmax}], x] // Rest
  • PARI
    a(n) = sum(k=1, n, ceil(n/k) % 2); \\ Michel Marcus, May 25 2020
    
  • Python
    from math import isqrt
    def A330926(n): return n+(s:=isqrt(n-1))**2-((t:=isqrt(m:=n-1>>1))**2<<1)-(sum((n-1)//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

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

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

Original entry on oeis.org

1, 0, 2, 2, 2, 2, 5, 5, 1, 4, 9, 9, 2, 2, 9, 17, 5, 5, 11, 11, 2, 12, 23, 23, -4, 1, 14, 26, 15, 15, 22, 22, -6, 8, 25, 37, 9, 9, 28, 44, 7, 7, 18, 18, 3, 35, 58, 58, -9, -2, 18, 38, 21, 21, 36, 52, 5, 27, 56, 56, -3, -3, 28, 68, 8, 26, 45, 45, 24, 50, 73, 73, -23, -23, 14
Offset: 1

Views

Author

Ilya Gutkovskiy, May 25 2020

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[(-1)^(k + 1) k Ceiling[n/k], {k, 1, n}], {n, 1, 75}]
    Table[(-1)^(n + 1) Ceiling[n/2] + Sum[DivisorSum[k, (-1)^(# + 1) # &], {k, 1, n - 1}], {n, 1, 75}]
    nmax = 75; CoefficientList[Series[x/(1 - x) (1/(1 + x)^2 + Sum[(-1)^(k + 1) k x^k/(1 - x^k), {k, 1, nmax}]), {x, 0, nmax}], x] // Rest
  • PARI
    a(n) = sum(k=1, n, (-1)^(k+1)*k*ceil(n/k)); \\ Michel Marcus, May 26 2020
    
  • Python
    from math import isqrt
    def A333505(n): return ((s:=isqrt(m:=n-1>>1))**2*(s+1)-sum((q:=m//k)*((k<<1)+q+1) for k in range(1,s+1))<<1)-((t:=isqrt(n-1))**2*(t+1)-sum((q:=(n-1)//k)*((k<<1)+q+1) for k in range(1,t+1))>>1) + (m+1 if n&1 else -m-1) # Chai Wah Wu, Oct 30 2023

Formula

G.f.: (x/(1 - x)) * (1/(1 + x)^2 + Sum_{k>=1} (-1)^(k+1) * k * x^k / (1 - x^k)).
a(n) = (-1)^(n+1) * ceiling(n/2) + Sum_{k=1..n-1} A002129(k).
a(n) = A001057(n) - A024919(n-1).

A332683 a(n) = Sum_{k=1..n, gcd(n, k) = 1} ceiling(n/k).

Original entry on oeis.org

1, 2, 5, 6, 12, 8, 20, 15, 23, 18, 37, 19, 47, 28, 38, 37, 66, 31, 76, 41, 61, 52, 96, 44, 96, 63, 89, 66, 129, 49, 141, 84, 109, 88, 129, 72, 176, 101, 132, 95, 198, 77, 210, 116, 142, 129, 232, 99, 226, 122, 186, 144, 269, 114, 232, 149, 214, 169, 305, 110
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 19 2020

Keywords

Comments

Moebius transform of A006590.

Crossrefs

Programs

  • Mathematica
    Table[Sum[Boole[GCD[n, k] == 1] Ceiling[n/k], {k, 1, n}], {n, 1, 60}]
  • PARI
    a(n) = sum(k=1, n, if (gcd(n, k) == 1, ceil(n/k))); \\ Michel Marcus, Feb 21 2020

Formula

a(n) = Sum_{d|n} mu(n/d) * A006590(d).
Showing 1-3 of 3 results.