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

A130849 a(n) is half the sum of the terms in the n-th antidiagonal of the table A130836.

Original entry on oeis.org

0, 1, 1, 4, 2, 7, 4, 9, 8, 15, 6, 19, 13, 16, 13, 28, 15, 32, 17, 28, 27, 40, 16, 41, 34, 39, 30, 55, 28, 59, 34, 53, 50, 59, 32, 75, 57, 64, 41, 84, 47, 88, 55, 66, 72, 97, 42, 97, 71, 90, 70, 113, 65, 104, 67, 104, 97, 128, 56, 133, 103, 102, 82, 129, 89, 150, 99, 130, 100
Offset: 1

Views

Author

Jacob Woolcutt (woolcutt(AT)gmail.com), Jul 21 2007

Keywords

Examples

			d(3, 1) = 1
d(2, 2) = 0
d(1, 3) = 1
So a(3) = 1/2 * (1 + 0 + 1) = 1
		

Crossrefs

Equals half the antidiagonal sums of A130836.

Programs

  • Mathematica
    MultDistance[m_, n_] := Module[{ mfac = FactorInteger[m], nfac = FactorInteger[ n]}, Plus @@ Map[(If[Length[ # ] == 1, #[[1, 2]], Abs[ #[[1, 2]] - #[[2, 2]]]]) &, Split[ Sort[Flatten[{mfac, nfac}, 1]], (#1[[1]] == #2[[1]]) &]]] DiagSum[n_] := 1/2 Sum[MultDistance[n - i, i + 1], {i, 0, n - 1}] Table[DiagSum[j], {j, 1, 1000}]
  • PARI
    multDist(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]))))};
    a(n)={sum(i=0, (n-1)/2, multDist(n-i, i+1))}; \\ edited by Michel Marcus, Sep 20 2018

Formula

a(n) = 1/2 * Sum_{i=0..n-1} d(n-i, i+1) where, if m = Sum_{k} p_k^e^k, and n = Sum_{k} p_k^f^k, then d(m, n) = Sum_{i=1..k} abs(e_i - f_i), the multiplicative distance between m and n.

Extensions

Program and corrections by Charles R Greathouse IV, Sep 02 2009
Edited by Michel Marcus, Sep 20 2018

A089913 Table T(n,k) = lcm(n,k)/gcd(n,k) = n*k/gcd(n,k)^2 read by antidiagonals (n >= 1, k >= 1).

Original entry on oeis.org

1, 2, 2, 3, 1, 3, 4, 6, 6, 4, 5, 2, 1, 2, 5, 6, 10, 12, 12, 10, 6, 7, 3, 15, 1, 15, 3, 7, 8, 14, 2, 20, 20, 2, 14, 8, 9, 4, 21, 6, 1, 6, 21, 4, 9, 10, 18, 24, 28, 30, 30, 28, 24, 18, 10, 11, 5, 3, 2, 35, 1, 35, 2, 3, 5, 11, 12, 22, 30, 36, 40, 42, 42, 40, 36, 30, 22, 12, 13, 6, 33, 10, 45
Offset: 1

Views

Author

Marc LeBrun, Nov 14 2003

Keywords

Comments

A multiplicative analog of absolute difference A049581. Exponents in prime factorization of T(n,k) are absolute differences of those of n and k. Commutative non-associative operator with identity 1. T(nx,kx)=T(n,k), T(n^x,k^x)=T(n,k)^x, etc.
The bivariate function log(T(., .)) is a distance (or metric) function. It is a weighted analog of A130836, in the sense that if e_i (resp. f_i) denotes the exponent of prime p_i in the factorization of m (resp. of n), then both log(T(m, n)) and A130836(m, n) are writable as Sum_{i} w_i * abs(e_i - f_i). For A130836, w_i = 1 for all i, whereas for log(T(., .)), w_i = log(p_i). - Luc Rousseau, Sep 17 2018
If the analog of absolute difference, as described in the first comment, is determined by factorization into distinct terms of A050376 instead of by prime factorization, the equivalent operation is defined by A059897 and is associative. The positive integers form a group under A059897. The two factorization methods give the same factorization for squarefree numbers (A005117), so that T(.,.) restricted to A005117 is associative. Thus the squarefree numbers likewise form a group under the operation defined by this sequence. - Peter Munn, Apr 04 2019

Examples

			T(6,10) = lcm(6,10)/gcd(6,10) = 30/2 = 15.
  1,  2,  3,  4,  5, ...
  2,  1,  6,  2, 10, ...
  3,  6,  1, 12, 15, ...
  4,  2, 12,  1, 20, ...
  5, 10, 15, 20,  1, ...
  ...
		

Crossrefs

Programs

  • GAP
    T:=Flat(List([1..13],n->List([1..n-1],k->Lcm(k,n-k)/Gcd(k,n-k)))); # Muniru A Asiru, Oct 24 2018
    
  • Mathematica
    Flatten[Table[LCM[i, m - i]/GCD[i, m - i], {m, 15}, {i, m - 1}]] (* Ivan Neretin, Apr 27 2015 *)
  • PARI
    A089913(n,k)=n*k/gcd(n,k)^2 \\ M. F. Hasler, Dec 06 2019

Formula

A130836(n, k) = A001222(T(n, k)). - Luc Rousseau, Sep 17 2018

A127185 Triangle of distances between n>=1 and n>=m>=1 measured by the number of non-common prime factors.

Original entry on oeis.org

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

Views

Author

R. J. Mathar, Mar 25 2007

Keywords

Comments

Consider the non-directed graph where each integer n >= 1 is a unique node labeled by n and where nodes n and m are connected if their list of exponents in their prime number decompositions n=p_1^n_1*p_2^n_2*... and m=p_1^m_1*p_2^m_2*... differs at one place p_i by 1. [So connectedness means n/m or m/n is a prime.] The distance between two nodes is defined by the number of hops on the shortest path between them. [Actually, the shortest path is not unique if the graph is not pruned to a tree by an additional convention like connecting only numbers that differ in the exponent of the largest prime factors; this does not change the distance here.] The formula says this can be computed by passing by the node of the greatest common divisor.

Examples

			T(8,10)=T(2^3,2*5)=3 as one must lower the power of p_1=2 two times and rise the power of p_3=5 once to move from 8 to 10. A shortest path is 8<->4<->2<->10 obtained by division through 2, division through 2 and multiplication by 5.
Triangle is read by rows and starts
   n\m 1 2 3 4 5 6 7 8 9 10
   ------------------------
    1| 0
    2| 1 0
    3| 1 2 0
    4| 2 1 3 0
    5| 1 2 2 3 0
    6| 2 1 1 2 3 0
    7| 1 2 2 3 2 3 0
    8| 3 2 4 1 4 3 4 0
    9| 2 3 1 4 3 2 3 5 0
   10| 2 1 3 2 1 2 3 3 4 0
		

Crossrefs

Cf. A130836.

Programs

  • 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], {n, 1, 14}, {m, 1, n}] // Flatten (* Jean-François Alcover, Jan 08 2014 *)
  • PARI
    T(n, k) = my(g=gcd(n,k)); bigomega(n/g) + bigomega(k/g);
    tabl(nn) = for(n=1, nn, for (k=1, n, print1(T(n, k), ", ")); print); \\ Michel Marcus, Dec 26 2018
    
  • PARI
    A127185(m,n)=vecsum(abs(factor(m/n)[, 2])) \\ M. F. Hasler, Dec 07 2019

Formula

T(n,m) = A001222(n/g)+A001222(m/g) where g=gcd(n,m)=A050873(n,m).
Special cases: T(n,n)=0. T(n,1)=A001222(n).
T(m,n) = A130836(m,n) = Sum |e_k| if m/n = Product p_k^e_k. - M. F. Hasler, Dec 08 2019
Showing 1-3 of 3 results.