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.

A305614 Expansion of Sum_{p prime} x^p/(1 + x^p).

Original entry on oeis.org

0, 0, 1, 1, -1, 1, 0, 1, -1, 1, 0, 1, -2, 1, 0, 2, -1, 1, 0, 1, -2, 2, 0, 1, -2, 1, 0, 1, -2, 1, -1, 1, -1, 2, 0, 2, -2, 1, 0, 2, -2, 1, -1, 1, -2, 2, 0, 1, -2, 1, 0, 2, -2, 1, 0, 2, -2, 2, 0, 1, -3, 1, 0, 2, -1, 2, -1, 1, -2, 2, -1, 1, -2, 1, 0, 2, -2, 2, -1
Offset: 0

Views

Author

Gus Wiseman, Jun 06 2018

Keywords

Comments

a(n) is the number of prime divisors p|n such that n/p is odd, minus the number of prime divisors p|n such that n/p is even.

Examples

			The prime divisors of 12 are 2, 3. We see that 12/2 = 6, 12/3 = 4. None of those are odd, but both of them are even, so a(12) = -2.
The prime divisors of 30 are {2,3,5} with quotients {15,10,6}. One of these is odd and two are even, so a(30) = 1 - 2 = -1.
		

Crossrefs

Programs

  • Maple
    a:= n-> -add((-1)^(n/i[1]), i=ifactors(n)[2]):
    seq(a(n), n=0..100);  # Alois P. Heinz, Jun 07 2018
    # Alternative
    N:= 1000: # to get a(0)..a(N)
    V:= Vector(N):
    p:= 1:
    do
      p:= nextprime(p);
      if p > N then break fi;
      R:= [seq(i,i=p..N,p)];
      W:= ;
      V[R]:= V[R]+W;
    od:
    [0,seq(V[i],i=1..N)]; # Robert Israel, Jun 07 2018
  • Mathematica
    Table[Sum[If[PrimeQ[d], (-1)^(n/d - 1), 0], {d, Divisors[n]}], {n, 30}]

Formula

a(n) = -Sum_{p|n prime} (-1)^(n/p).
From Robert Israel, Jun 07 2018: (Start)
If n is odd, a(n) = A001221(n).
If n == 2 (mod 4), a(n) = 2 - A001221(n).
If n == 0 (mod 4) and n > 0, a(n) = -A001221(n). (End)
L.g.f.: log(Product_{k>=1} (1 + x^prime(k))^(1/prime(k))) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, Jul 30 2018