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.

A342403 a(1) = 1; a(n) = -Sum_{d|n, d < n} d * a(d).

Original entry on oeis.org

1, -1, -1, 1, -1, 4, -1, -3, 2, 6, -1, -24, -1, 8, 7, 21, -1, -38, -1, -58, 9, 12, -1, 288, 4, 14, -16, -108, -1, -180, -1, -315, 13, 18, 11, 930, -1, 20, 15, 1126, -1, -314, -1, -256, -116, 24, -1, -6960, 6, -154, 19, -354, -1, 1078, 15, 2940, 21, 30, -1, 6664, -1, 32, -198, 9765, 17
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 10 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = -Sum[d a[d], {d, Most @ Divisors[n]}]; Table[a[n], {n, 1, 65}]
  • PARI
    a(n) = if (n==1, 1, -sumdiv(n, d, if (dMichel Marcus, Mar 11 2021
    
  • PARI
    up_to = 20000;
    A342403list(n) = { my(v=vector(n)); v[1] = 1; for(n=2, #v, v[n] = -sumdiv(n, d, if(d==n, 0, v[d]*d))); (v); };
    v342403 = A342403list(up_to);
    A342403(n) = v342403[n]; \\ Antti Karttunen, Jan 22 2025
    
  • Python
    from sympy import divisors
    def A342403(n): return 1 if n == 1 else -sum(d*A342403(d) for d in divisors(n) if d < n) # Chai Wah Wu, Mar 11 2021