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

A332423 If n = Product (p_j^k_j) then a(n) = Sum ((-1)^(k_j + 1) * k_j).

Original entry on oeis.org

0, 1, 1, -2, 1, 2, 1, 3, -2, 2, 1, -1, 1, 2, 2, -4, 1, -1, 1, -1, 2, 2, 1, 4, -2, 2, 3, -1, 1, 3, 1, 5, 2, 2, 2, -4, 1, 2, 2, 4, 1, 3, 1, -1, -1, 2, 1, -3, -2, -1, 2, -1, 1, 4, 2, 4, 2, 2, 1, 0, 1, 2, -1, -6, 2, 3, 1, -1, 2, 3, 1, 1, 1, 2, -1, -1, 2, 3, 1, -3
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 12 2020

Keywords

Comments

Sum of odd exponents in prime factorization of n minus the sum of even exponents in prime factorization of n.

Examples

			a(2700) = a(2^2 * 3^3 * 5^2) = -2 + 3 - 2 = -1.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Plus @@ ((-1)^(#[[2]] + 1) #[[2]] & /@ FactorInteger[n]); a[1] = 0; Table[a[n], {n, 1, 80}]
  • PARI
    a(n) = vecsum(apply(x -> (-1)^(x+1) * x, factor(n)[, 2])); \\ Amiram Eldar, Oct 09 2023

Formula

From Amiram Eldar, Oct 09 2023: (Start)
Additive with a(p^e) = (-1)^(e+1) * e.
a(n) = A350387(n) - A350386(n).
Sum_{k=1..n} a(k) ~ n * (log(log(n)) + B - C), where B is Mertens's constant (A077761) and C = Sum_{p prime} (3*p+1)/(p*(p+1)^2) = 0.81918453457738985491 ... . (End)

A332424 If n = Product (p_j^k_j) then a(n) = Sum ((-1)^(pi(p_j) + 1) * p_j), where pi = A000720.

Original entry on oeis.org

0, 2, -3, 2, 5, -1, -7, 2, -3, 7, 11, -1, -13, -5, 2, 2, 17, -1, -19, 7, -10, 13, 23, -1, 5, -11, -3, -5, -29, 4, 31, 2, 8, 19, -2, -1, -37, -17, -16, 7, 41, -8, -43, 13, 2, 25, 47, -1, -7, 7, 14, -11, -53, -1, 16, -5, -22, -27, 59, 4, -61, 33, -10, 2, -8, 10, 67, 19, 20
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 12 2020

Keywords

Comments

Sum of distinct prime factors of n with odd indices minus the sum of distinct prime factors of n with even indices.

Examples

			a(66) = a(2 * 3 * 11) = a(prime(1) * prime(2) * prime(5)) = 2 - 3 + 11 = 10.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Plus @@ ((-1)^(PrimePi[#[[1]]] + 1) #[[1]] & /@ FactorInteger[n]); a[1] = 0; Table[a[n], {n, 1, 69}]
    nmax = 69; CoefficientList[Series[Sum[(-1)^(k + 1) Prime[k] x^Prime[k]/(1 - x^Prime[k]), {k, 1, nmax}], {x, 0, nmax}], x] // Rest

Formula

G.f.: Sum_{k>=1} (-1)^(k + 1) * prime(k) * x^prime(k) / (1 - x^prime(k)).
L.g.f.: log(Product_{k>=1} (1 - x^prime(k))^((-1)^k)).

A366725 Sum of odd indices of distinct prime factors of n.

Original entry on oeis.org

0, 1, 0, 1, 3, 1, 0, 1, 0, 4, 5, 1, 0, 1, 3, 1, 7, 1, 0, 4, 0, 6, 9, 1, 3, 1, 0, 1, 0, 4, 11, 1, 5, 8, 3, 1, 0, 1, 0, 4, 13, 1, 0, 6, 3, 10, 15, 1, 0, 4, 7, 1, 0, 1, 8, 1, 0, 1, 17, 4, 0, 12, 0, 1, 3, 6, 19, 8, 9, 4, 0, 1, 21, 1, 3, 1, 5, 1, 0, 4, 0, 14, 23, 1, 10, 1, 0, 6, 0, 4, 0, 10, 11, 16, 3, 1, 25, 1, 5, 4
Offset: 1

Views

Author

Ilya Gutkovskiy, Oct 24 2023

Keywords

Examples

			a(60) = 4 because 60 = 2^2 * 3 * 5 = prime(1)^2 * prime(2) * prime(3) and 1 + 3 = 4.
		

Crossrefs

Cf. A000720 (pi), A066207 (positions of 0's), A066328, A324966, A332422, A344908, A366528, A366784.

Programs

  • Mathematica
    nmax = 100; CoefficientList[Series[Sum[(2 k - 1) x^Prime[2 k - 1]/(1 - x^Prime[2 k - 1]), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    f[p_, e_] := Module[{i = PrimePi[p]}, If[OddQ[i], i, 0]]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jul 03 2025 *)
  • PARI
    f(n) = if(n % 2, n, 0);
    a(n) = vecsum(apply(x -> f(primepi(x)), factor(n)[, 1])); \\ Amiram Eldar, Jul 03 2025

Formula

G.f.: Sum_{k>=1} (2*k-1) * x^prime(2*k-1) / (1 - x^prime(2*k-1)).
From Amiram Eldar, Jul 03 2025: (Start)
Additive with a(p^e) = pi(p) if pi(p) is odd, and 0 otherwise.
a(n) = A066328(n) - 2*A366784(n). (End)

A366784 Sum of even indices of distinct prime factors of n divided by 2.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 2, 0, 1, 0, 0, 1, 3, 2, 1, 0, 0, 1, 4, 0, 3, 0, 0, 1, 0, 3, 1, 2, 5, 1, 0, 0, 1, 0, 2, 1, 6, 4, 4, 0, 0, 3, 7, 0, 1, 0, 0, 1, 2, 0, 1, 3, 8, 1, 0, 2, 5, 5, 0, 1, 9, 0, 3, 0, 3, 1, 0, 0, 1, 2, 10, 1, 0, 6, 1, 4, 2, 4, 11, 0, 1, 0, 0, 3, 0, 7, 6, 0, 12, 1, 5, 0, 1, 0, 4, 1, 0, 2, 1
Offset: 1

Views

Author

Ilya Gutkovskiy, Oct 24 2023

Keywords

Examples

			a(315) = 3 because 315 = 3^2 * 5 * 7 = prime(2)^2 * prime(3) * prime(4) and (2 + 4) / 2 = 3.
		

Crossrefs

Cf. A000720 (pi), A066208 (positions of 0's), A066328, A324967, A332422, A344931, A366533, A366725.

Programs

  • Mathematica
    nmax = 100; CoefficientList[Series[Sum[k x^Prime[2 k]/(1 - x^Prime[2 k]), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    f[p_, e_] := Module[{i = PrimePi[p]}, If[EvenQ[i], i/2, 0]]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jul 03 2025 *)
  • PARI
    f(n) = if(n % 2, 0, n/2);
    a(n) = vecsum(apply(x -> f(primepi(x)), factor(n)[, 1])); \\ Amiram Eldar, Jul 03 2025

Formula

G.f.: Sum_{k>=1} k * x^prime(2*k) / (1 - x^prime(2*k)).
From Amiram Eldar, Jul 03 2025: (Start)
Additive with a(p^e) = pi(p)/2 if pi(p) is even, and 0 otherwise.
a(n) = (A066328(n) - A366725(n))/2. (End)

A347103 G.f.: Sum_{k>=1} k * x^prime(k) / (1 + x^prime(k)).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Aug 18 2021

Keywords

Comments

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

Crossrefs

Programs

  • Mathematica
    nmax = 72; CoefficientList[Series[Sum[k x^Prime[k]/(1 + x^Prime[k]), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    Table[-DivisorSum[n, (-1)^(n/#) PrimePi[#] &, PrimeQ[#] &], {n, 1, 72}]
  • PARI
    a(n) = my(f=factor(n)[,1]); sum(k=1, #f, if ((n/f[k]) % 2, primepi(f[k]), -primepi(f[k]))); \\ Michel Marcus, Aug 19 2021

Formula

a(n) = -Sum_{p|n, p prime} (-1)^(n/p) * pi(p), where pi = A000720.

A382331 If n = Product (p_j^k_j) then a(n) = -Sum ((-1)^k_j * p_j).

Original entry on oeis.org

0, 2, 3, -2, 5, 5, 7, 2, -3, 7, 11, 1, 13, 9, 8, -2, 17, -1, 19, 3, 10, 13, 23, 5, -5, 15, 3, 5, 29, 10, 31, 2, 14, 19, 12, -5, 37, 21, 16, 7, 41, 12, 43, 9, 2, 25, 47, 1, -7, -3, 20, 11, 53, 5, 16, 9, 22, 31, 59, 6, 61, 33, 4, -2, 18, 16, 67, 15, 26, 14, 71, -1, 73, 39, -2
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 22 2025

Keywords

Examples

			a(72) = a(2^3*3^2) = 2 - 3 = -1.
		

Crossrefs

Programs

  • Mathematica
    Join[{0}, Table[-Plus @@ ((-1)^#[[2]] #[[1]] & /@ FactorInteger[n]), {n, 2, 75}]]
  • PARI
    a(n) = my(f=factor(n)); -sum(i=1, #f~, (-1)^f[i,2]*f[i,1]); \\ Michel Marcus, Mar 22 2025

Formula

Additive with a(p^e) = (-1)^(e+1) * p.

A382477 If n = Product (p_j^k_j) then a(n) = -Sum ((-1)^k_j * k_j * p_j).

Original entry on oeis.org

0, 2, 3, -4, 5, 5, 7, 6, -6, 7, 11, -1, 13, 9, 8, -8, 17, -4, 19, 1, 10, 13, 23, 9, -10, 15, 9, 3, 29, 10, 31, 10, 14, 19, 12, -10, 37, 21, 16, 11, 41, 12, 43, 7, -1, 25, 47, -5, -14, -8, 20, 9, 53, 11, 16, 13, 22, 31, 59, 4, 61, 33, 1, -12, 18, 16, 67, 13, 26, 14, 71, 0, 73, 39, -7
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 10 2025

Keywords

Examples

			a(72) = a(2^3*3^2) = 3*2 - 2*3 = 0.
		

Crossrefs

Programs

  • Mathematica
    Join[{0}, Table[-Plus @@ ((-1)^#[[2]] #[[2]] #[[1]] & /@ FactorInteger[n]), {n, 2, 75}]]
  • PARI
    a(n) = my(f=factor(n)); -sum(k=1, #f~, (-1)^f[k,2]*f[k,2]*f[k,1]); \\ Michel Marcus, Apr 17 2025
Showing 1-7 of 7 results.