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.

A317843 Dirichlet inverse of Stern's diatomic sequence (A002487).

Original entry on oeis.org

1, -1, -2, 0, -3, 2, -3, 0, 0, 3, -5, 0, -5, 3, 8, 0, -5, 0, -7, 0, 4, 5, -7, 0, 2, 5, 0, 0, -7, -8, -5, 0, 14, 5, 9, 0, -11, 7, 10, 0, -11, -4, -13, 0, -8, 7, -9, 0, 0, -2, 8, 0, -13, 0, 19, 0, 18, 7, -11, 0, -9, 5, 14, 0, 23, -14, -11, 0, 14, -9, -13, 0, -15, 11, -20, 0, 13, -10, -13, 0, 2, 11, -19, 0, 9, 13, 10, 0, -17, 8, 11, 0
Offset: 1

Views

Author

Antti Karttunen, Aug 09 2018

Keywords

Crossrefs

Programs

  • Mathematica
    s[0] = 0; s[1] = 1;
    s[n_] := s[n] = If[EvenQ[n], s[n/2], s[(n-1)/2] + s[(n+1)/2]];
    a[n_] := a[n] = If[n == 1, 1, -Sum[s[n/d] a[d], {d, Most@ Divisors[n]}]];
    Array[a, 100] (* Jean-François Alcover, Feb 16 2020 *)
  • PARI
    A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487
    A317843(n) = if(1==n,1,-sumdiv(n,d,if(dA002487(n/d)*A317843(d),0)));

Formula

a(1) = 1; for n > 1, a(n) = -Sum_{d|n, dA002487(n/d)*a(d).