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.

A130836 Square array d(m,n) = multiplicative distance between m>=1 and n>=1, read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 1, 0, 1, 2, 2, 2, 2, 1, 1, 0, 1, 1, 2, 2, 3, 3, 2, 2, 1, 1, 2, 0, 2, 1, 1, 3, 2, 1, 3, 3, 1, 2, 3, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 3, 4, 3, 3, 3, 3, 4, 3, 2, 1, 1, 1, 1, 2, 0, 2, 1, 1, 1, 1, 3, 2, 3, 4, 4, 3, 3, 4, 4, 3, 2, 3, 1, 2, 2, 2, 3, 3, 0, 3, 3, 2, 2, 2, 1, 2, 2, 2, 3, 1, 2, 4, 4, 2, 1, 3, 2, 2, 2
Offset: 1

Views

Author

N. J. A. Sloane, Sep 28 2007

Keywords

Comments

If m = p_1^e_1 * p_2^e_2 * ... * p_k^e^k and n = p_1^f_1 * p_2^f_2 * ... * p_k^f^k, we define d(m, n) = Sum_{i = 1..k} |e_i - f_i| to be the multiplicative distance between m and n (see A130849).
Equivalently, if m/n = Product p_k^e_k, then d(m,n) = Sum |e_k|. - M. F. Hasler, Dec 08 2019

Examples

			Array begins:
0 1 1 2 1 2 1 3 ...
1 0 2 1 2 1 2 2 ...
1 2 0 3 2 1 2 4 ...
2 1 3 0 3 2 3 1 ...
...
		

Crossrefs

Half of antidiagonal sums gives A130849. First row is A001222.

Programs

  • Maple
    A001222 := proc(n) numtheory[bigomega](n) ; end: A127185 := proc(n,m) local g ; g := gcd(n,m) ; RETURN(A001222(n/g)+A001222(m/g)) ; end: A130836 := proc(n,m) A127185(n,m) ; end: for d from 1 to 17 do for n from 1 to d do printf("%d, ",A130836(n,d-n+1)) ; od: od: # R. J. Mathar, Oct 17 2007
    g:= proc(s) local t;
      if s = 1 then 0
      elif type(s,function) then 1
      elif type(s,`^`) then abs(op(2,s))
      else add(procname(t),t=s)
      fi
    end proc:
    f:= (m,n) -> g(ifactor(m)/ifactor(n)):
    seq(seq(f(m,n-m),m=1..n-1), n=1..20); # Robert Israel, Sep 17 2018
  • Mathematica
    t[n_, n_] = 0; t[n_, 1] := PrimeOmega[n]; t[n_, m_] := With[{g = GCD[n, m]}, PrimeOmega[n/g] + PrimeOmega[m/g]];  Table[t[n-m+1, m], {n, 1, 14}, {m, 1, n}] // Flatten (* Jean-François Alcover, Jan 17 2014, after R. J. Mathar *)
  • PARI
    T(m, n) = {if (m==n, 0, my(f=vecsort(concat(factor(m)[, 1], factor(n)[, 1]),, 8)); sum(i=1, #f, abs(valuation(m, f[i])-valuation(n, f[i]))))}; \\ Michel Marcus, Sep 20 2018
    
  • PARI
    A130836(m,n)=vecsum(abs(factor(m/n)[,2])) \\ M. F. Hasler, Dec 07 2019

Formula

a(n,m) = A127185(n,m). - R. J. Mathar, Oct 17 2007

Extensions

More terms from R. J. Mathar, Oct 17 2007