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.

A343923 If n = Product (p_j^k_j) then a(n) = Sum (abs(p_j-k_j)) (a(1) = 0 by convention).

Original entry on oeis.org

0, 1, 2, 0, 4, 3, 6, 1, 1, 5, 10, 2, 12, 7, 6, 2, 16, 2, 18, 4, 8, 11, 22, 3, 3, 13, 0, 6, 28, 7, 30, 3, 12, 17, 10, 1, 36, 19, 14, 5, 40, 9, 42, 10, 5, 23, 46, 4, 5, 4, 18, 12, 52, 1, 14, 7, 20, 29, 58, 6, 60, 31, 7, 4, 16, 13, 66, 16, 24, 11, 70, 2, 72
Offset: 1

Views

Author

Peter Schorn, May 04 2021

Keywords

Examples

			a(24) = a(2^3 * 3) = abs(2 - 3) + abs(3 - 1) = 3. a(27) = a(3^3) = 0.
		

Crossrefs

Cf. A008474.

Programs

  • Mathematica
    a[n_] := Plus @@ (Abs[#[[1]] - #[[2]]] & /@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, May 04 2021 *)
  • PARI
    a(n)=local(t); if(n<1, 0, t=factor(n); vecsum(abs(t[,1]-t[,2])))

Formula

Additive with a(p^e) = abs(p-e).