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.

Previous Showing 31-40 of 59 results. Next

A075175 Prime factorization of n encoded by interleaving successive prime exponents in unary to bit-positions given by columns of A001477.

Original entry on oeis.org

0, 1, 2, 5, 8, 3, 64, 37, 18, 9, 1024, 7, 32768, 65, 10, 549, 2097152, 19, 268435456, 13, 66, 1025, 68719476736, 39, 136, 32769, 274, 69, 35184372088832, 11, 36028797018963968, 16933, 1026, 2097153, 72, 23, 73786976294838206464
Offset: 1

Views

Author

Antti Karttunen, Sep 13 2002

Keywords

Comments

Here we store the exponent e_i of p_i (p1=2, p2=3, p3=5, ...) in the factorization of n to the bit positions given by the column i-1 of A001477 viewed as a table (the exponent of 2 is thus stored to bit positions 0, 2, 5, 9, 14, 20, ..., exponent of 3 to 1, 4, 8, 13, 19, ..., exponent of 5 to 3, 7, 12, 18, 25, ...) using unary system, i.e. we actually store 2^(e_i) - 1 in binary.
This injective mapping from N to N offers an example of the proof given in Cameron's book that any distributive lattice can be represented as a sublattice of the power-set lattice P(X) of some set X. With this we can implement GCD (A003989) with bitwise AND (A004198) and LCM (A003990) with bitwise OR (A003986). Also, to test whether x divides y, it is enough to check that ((a(x) OR a(y)) XOR a(y)) = A003987(A003986(a(x),a(y)),a(y)) is zero.

Examples

			a(24) = 39 because 24 = 2^3 * 3^1 so we add the binary words 100101 and 10 to get 100111 in binary = 39 in decimal and a(25) = 136 because 25 = 5^2 so we form a binary word 10001000 = 136 in decimal.
		

References

  • P. J. Cameron, Combinatorics: Topics, Techniques, Algorithms, Cambridge University Press, 1998, page 191. (12.3. Distributive lattices)

Crossrefs

Variant: A075173. Inverse: A075176.
A003989(x, y) = A075176(A004198(a(x), a(y))), A003990(x, y) = A075176(A003986(a(x), a(y))).

A106465 Triangle read by rows, T(n, k) = 1 if n mod 2 = 1, otherwise (k + 1) mod 2.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Paul Barry, May 03 2005

Keywords

Comments

Rows alternate between all 1's and alternating 1's and 0's. A 'mixed' sequence array: rows alternate between the rows of the sequence array for the all 1's sequence and the sequence array for the sequence 1,0,1,0,...
Column 2*k has g.f. x^(2*k)/(1-x); column 2*k+1 has g.f. x^(2*k+1)/(1-x^2).
Row sums are A029578(n+2). Antidiagonal sums are A106466.
This triangle is the Kronecker product of an infinite lower triangular matrix filled with 1's with a 2 X 2 lower triangular matrix of 1's. - Christopher Cormier, Sep 24 2017
From Peter Bala, Aug 21 2021: (Start)
Using the notation of Davenport et al.:
This is the double Riordan array ( 1/(1 - x); x/(1 + x), x*(1 + x) ).
The inverse array equals ( (1 - x)*(1 - x^2); x*(1 - x), x*(1 + x) ).
They are examples of double Riordan arrays of the form (g(x); x*f_1(x), x*f_2(x)), where f_1(x)*f_2(x) = 1. Arrays of this type form a group under matrix multiplication. For the group law see the Bala link. (End)

Examples

			The triangle begins:
  n\k| 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 ...
  ---+------------------------------------------------
   0 | 1
   1 | 1  1
   2 | 1  0  1
   3 | 1  1  1  1
   4 | 1  0  1  0  1
   5 | 1  1  1  1  1  1
   6 | 1  0  1  0  1  0  1
   7 | 1  1  1  1  1  1  1  1
   8 | 1  0  1  0  1  0  1  0  1
   9 | 1  1  1  1  1  1  1  1  1  1
  10 | 1  0  1  0  1  0  1  0  1  0  1
  11 | 1  1  1  1  1  1  1  1  1  1  1  1
  12 | 1  0  1  0  1  0  1  0  1  0  1  0  1
  13 | 1  1  1  1  1  1  1  1  1  1  1  1  1  1
  14 | 1  0  1  0  1  0  1  0  1  0  1  0  1  0  1
... Reformatted by _Wolfdieter Lang_, May 12 2018
Inverse array begins
  n\k|  0   1   2   3   4   5   6   7
  ---+-------------------------------
   0 |  1
   1 | -1   1
   2 | -1   0   1
   3 |  1  -1  -1   1
   4 |  0   0  -1   0   1
   5 |  0   0   1  -1  -1   1
   6 |  0   0   0   0  -1   0   1
   7 |  0   0   0   0   1  -1  -1  1
  ... - _Peter Bala_, Aug 21 2021
		

Crossrefs

Programs

  • Maple
    T := (n, k) -> if igcd(n - k + 1, k + 1) mod 2 = 0 then 0 else 1 fi:
    for n from 0 to 9 do seq(T(n, k), k = 0..n) od;
    # Alternative:
    T := (n, k) -> if n mod 2 = 1 then 1 else (k + 1) mod 2 fi:
    for n from 0 to 9 do seq(T(n, k), k = 0..n) od; # Peter Luschny, Dec 12 2022
  • Mathematica
    Table[Binomial[Mod[n, 2], Mod[k, 2]], {n, 0, 16}, {k, 0, n}] // Flatten (* Michael De Vlieger, Dec 12 2022 *)
  • Python
    def A106465row(n: int) -> list[int]:
      if n % 2 == 1:
          return [1] * (n + 1)
      return [1, 0] * (n // 2) + [1]
    for n in range(9): print(A106465row(n)) # Peter Luschny, Dec 12 2022

Formula

If gcd(n - k + 1, k + 1) mod 2 = 0 then T(n, k) = 0, otherwise T(n, k) = 1.
T(n, k) = A003989(n + 1, k + 1) mod 2.
T(n, k) = binomial(n mod 2, k mod 2). - Peter Luschny, Dec 12 2022

Extensions

Edited and new name by Peter Luschny, Dec 12 2022

A286102 Square array A(n,k) read by antidiagonals: A(n,k) = T(lcm(n,k), gcd(n,k)), where T(n,k) is sequence A000027 considered as a two-dimensional table.

Original entry on oeis.org

1, 3, 3, 6, 5, 6, 10, 21, 21, 10, 15, 14, 13, 14, 15, 21, 55, 78, 78, 55, 21, 28, 27, 120, 25, 120, 27, 28, 36, 105, 34, 210, 210, 34, 105, 36, 45, 44, 231, 90, 41, 90, 231, 44, 45, 55, 171, 300, 406, 465, 465, 406, 300, 171, 55, 66, 65, 64, 63, 630, 61, 630, 63, 64, 65, 66, 78, 253, 465, 666, 820, 903, 903, 820, 666, 465, 253, 78, 91, 90, 561, 230, 1035, 324, 85, 324, 1035, 230, 561, 90, 91
Offset: 1

Views

Author

Antti Karttunen, May 03 2017

Keywords

Comments

The array is read by descending antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.

Examples

			The top left 12 X 12 corner of the array:
   1,   3,   6,  10,   15,   21,   28,   36,   45,   55,   66,   78
   3,   5,  21,  14,   55,   27,  105,   44,  171,   65,  253,   90
   6,  21,  13,  78,  120,   34,  231,  300,   64,  465,  561,  103
  10,  14,  78,  25,  210,   90,  406,   63,  666,  230,  990,  117
  15,  55, 120, 210,   41,  465,  630,  820, 1035,  101, 1540, 1830
  21,  27,  34,  90,  465,   61,  903,  324,  208,  495, 2211,  148
  28, 105, 231, 406,  630,  903,   85, 1596, 2016, 2485, 3003, 3570
  36,  44, 300,  63,  820,  324, 1596,  113, 2628,  860, 3916,  375
  45, 171,  64, 666, 1035,  208, 2016, 2628,  145, 4095, 4950,  739
  55,  65, 465, 230,  101,  495, 2485,  860, 4095,  181, 6105, 1890
  66, 253, 561, 990, 1540, 2211, 3003, 3916, 4950, 6105,  221, 8778
  78,  90, 103, 117, 1830,  148, 3570,  375,  739, 1890, 8778,  265
		

Crossrefs

Cf. A000217 (row 1 and column 1), A001844 (main diagonal).

Programs

Formula

A(n,k) = T(lcm(n,k), gcd(n,k)), where T(n,k) is sequence A000027 considered as a two-dimensional table, that is, as a pairing function from N x N to N.
A(n,k) = A(k,n), or equivalently, a(A038722(n)) = a(n). [Array is symmetric.]

A106475 An alternating sum of greatest common divisors.

Original entry on oeis.org

1, 0, 1, -4, 1, -8, 1, -16, -3, -16, 1, -36, 1, -24, -15, -48, 1, -48, 1, -68, -23, -40, 1, -112, -15, -48, -27, -100, 1, -120, 1, -128, -39, -64, -47, -180, 1, -72, -47, -208, 1, -176, 1, -164, -99, -88, 1, -304, -35, -160, -63, -196, 1, -216, -79, -304, -71, -112, 1, -420, 1, -120, -147, -320, -95, -288, 1, -260, -87
Offset: 0

Views

Author

Paul Barry, May 03 2005

Keywords

Comments

With interpolated 0's, this is Sum_{k=0..n} gcd(n-k+1,k+1)*(-1)^k.

Crossrefs

Negated bisection of A344373.

Programs

Formula

a(n) = Sum_{k=0..2*n} gcd(2*n-k+1, k+1)*(-1)^k.
a(n) = 2(n+1) - A344371(2(n+1)) = 2(n+1) - A344372(n+1) = 2(n+1) + A199084(2(n+1)). - Max Alekseyev, May 16 2021
Sum_{k=1..n} a(k) ~ n^2 * (1 - (4/Pi^2)*(log(n) + 2*gamma - 1/2 - log(2)/3 - zeta'(2)/zeta(2))), where gamma is Euler's constant (A001620). - Amiram Eldar, Mar 30 2024

Extensions

More terms from Antti Karttunen, Mar 30 2021

A324350 Square array read by antidiagonals: A(x,y) = gcd(A276086(x),A276086(y)), for x, y >= 0.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 3, 2, 1, 1, 1, 3, 3, 1, 1, 1, 2, 3, 6, 3, 2, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1, 2, 1, 6, 9, 6, 1, 2, 1, 1, 1, 1, 1, 9, 9, 1, 1, 1, 1, 1, 2, 3, 2, 1, 18, 1, 2, 3, 2, 1, 1, 1, 3, 3, 1, 1, 1, 1, 3, 3, 1, 1, 1, 2, 3, 6, 3, 2, 5, 2, 3, 6, 3, 2, 1, 1, 1, 3, 3, 3, 3, 5, 5, 3, 3, 3, 3, 1, 1, 1, 2, 1, 6, 9, 6, 5, 10, 5, 6, 9, 6, 1, 2, 1
Offset: 0

Views

Author

Antti Karttunen, Feb 25 2019

Keywords

Examples

			The array A begins:
       0   1   2   3   4   5   6   7   8   9  10  11  12
  x/y  ------------------------------------------------------
   0:  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, ...
   1:  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1,  2,  1, ...
   2:  1,  1,  3,  3,  3,  3,  1,  1,  3,  3,  3,  3,  1, ...
   3:  1,  2,  3,  6,  3,  6,  1,  2,  3,  6,  3,  6,  1, ...
   4:  1,  1,  3,  3,  9,  9,  1,  1,  3,  3,  9,  9,  1, ...
   5:  1,  2,  3,  6,  9, 18,  1,  2,  3,  6,  9, 18,  1, ...
   6:  1,  1,  1,  1,  1,  1,  5,  5,  5,  5,  5,  5,  5, ...
   7:  1,  2,  1,  2,  1,  2,  5, 10,  5, 10,  5, 10,  5, ...
   8:  1,  1,  3,  3,  3,  3,  5,  5, 15, 15, 15, 15,  5, ...
   9:  1,  2,  3,  6,  3,  6,  5, 10, 15, 30, 15, 30,  5, ...
  10:  1,  1,  3,  3,  9,  9,  5,  5, 15, 15, 45, 45,  5, ...
  11:  1,  2,  3,  6,  9, 18,  5, 10, 15, 30, 45, 90,  5, ...
  12:  1,  1,  1,  1,  1,  1,  5,  5,  5,  5,  5,  5, 25, ...
		

Crossrefs

Cf. A003989, A276086 (central diagonal), A324198, A324351.

Programs

  • PARI
    up_to = 65703; \\ = binomial(362+1,2)
    A276086(n) = { my(i=0,m=1,pr=1,nextpr); while((n>0),i=i+1; nextpr = prime(i)*pr; if((n%nextpr),m*=(prime(i)^((n%nextpr)/pr));n-=(n%nextpr));pr=nextpr); m; };
    A324350sq(row,col) = gcd(A276086(row),A276086(col));
    A324350list(up_to) = { my(v = vector(up_to), i=0); for(a=0,oo, for(col=0,a, if(i++ > up_to, return(v)); v[i] = A324350sq(a-col,col))); (v); };
    v324350 = A324350list(up_to);
    A324350(n) = v324350[1+n];

Formula

A(x,y) = gcd(A276086(x), A276086(y)).
A(x,y) = A276086(A324351(x,y)).

A106448 Table of (x+y)/gcd(x,y) where (x,y) runs through the pairs (1,1), (1,2), (2,1), (1,3), (2,2), (3,1), ...

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 21 2005

Keywords

Comments

Can also be viewed as a triangular table T(n,k) (n>=1, 1<=k<=n) read by rows: T(1,1); T(2,1), T(2,2); T(3,1), T(3,2), T(3,3); T(4,1), T(4,2), T(4,3), T(4,4); ... where T(n,k) gives the least value v>0 such that v*k = 0 modulo n+1, i.e., in other words, T(n,k) = (n+1)/gcd(n+1,k).

Examples

			The top left corner of the square array is:
   2  3  4  5  6  7  8  9 10 11 ...
   3  2  5  3  7  4  9  5 11 ...
   4  5  2  7  8  3 10 11 ...
   5  3  7  2  9  5 11 ...
   6  7  8  9  2 11 ...
   7  4  3  5 11 ...
   8  9 10 11 ...
   9  5 11 ...
  10 11 ...
  11 ...
		

Crossrefs

GF(2)[X] analog: A106449. Row 1 is n+1, row 2 is LEFT(LEFT(LEFT(A026741))), row 3 is LEFT^4(A051176). Essentially the same as A054531, but without its right-hand edge of all-1's.

Formula

T(n, k) = numerator((n+k)/n) = numerator((n+k)/k). - Michel Marcus, Dec 29 2013

A178252 Triangle T(n,m) read by rows: the numerator of the coefficient [x^m] of the umbral inverse Bernoulli polynomials B^{-1}(n,x), 0 <= m <= n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 2, 1, 1, 1, 5, 10, 5, 1, 1, 1, 3, 5, 5, 3, 1, 1, 1, 7, 7, 35, 7, 7, 1, 1, 1, 4, 28, 14, 14, 28, 4, 1, 1, 1, 9, 12, 21, 126, 21, 12, 9, 1, 1, 1, 5, 15, 30, 42, 42, 30, 15, 5, 1, 1, 1, 11, 55, 165, 66, 77, 66, 165, 55, 11, 1, 1, 1, 6, 22, 55, 99, 132, 132, 99, 55, 22, 6, 1
Offset: 0

Views

Author

Paul Curtz, May 24 2010

Keywords

Comments

The fractions A053382(n,m)/A053383(n,m) give the triangle of the coefficients of the Bernoulli polynomials:
1;
-1/2, 1;
1/6, -1, 1;
0, 1/2, -3/2, 1;
-1/30, 0, 1, -2, 1;
0, -1/6, 0, 5/3, -5/2, 1;
1/42, 0, -1/2, 0, 5/2, -3, 1;
The matrix inverse of this triangle defines coefficients of the umbral inverse Bernoulli polynomials B^{-1}(n,x) in row n:
1;
1/2, 1;
1/3, 1, 1;
1/4, 1, 3/2, 1;
1/5, 1, 2, 2, 1;
1/6, 1, 5/2, 10/3, 5/2, 1;
1/7, 1, 3, 5, 5, 3, 1;
1/8, 1, 7/2, 7, 35/4, 7, 7/2, 1;
1/9, 1, 4, 28/3, 14, 14, 28/3, 4, 1;
1/10, 1, 9/2, 12, 21, 126/5, 21, 12, 9/2, 1;
1/11, 1, 5, 15, 30, 42, 42, 30, 15, 5, 1;
The current triangle T(n,m) is the numerator of the entry in row n and column m.
In the majority of cases, T(n,m) = A050169(n,m), but since we use the numerators of the reduced fractions, an integer factor may be missing in this equation.
Umbral composition (e.g., B(.,x)^k = B(k,x)) gives B^(-1)(n,B(.,x)) = x^n = B(n,B^(-1)(.,x)). - Tom Copeland, Aug 25 2015

Examples

			The triangle T(n,k) begins:
n\k 0 1  2  3   4   5   6    7   8   9  10 11 12 13
0:  1
1:  1 1
2:  1 1  1
3:  1 1  3  1
4:  1 1  2  2   1
5:  1 1  5 10   5   1
6:  1 1  3  5   5   3   1
7:  1 1  7  7  35   7   7    1
8:  1 1  4 28  14  14  28    4   1
9:  1 1  9 12  21 126  21   12   9   1
10: 1 1  5 15  30  42  42   30  15   5   1
11: 1 1 11 55 165  66  77   66 165  55  11  1
12: 1 1  6 22  55  99 132  132  99  55  22  6  1
13: 1 1 13 26 143 143 429 1716 429 143 143 26 13  1
... reformatted. - _Wolfdieter Lang_, Aug 25 2015
		

Crossrefs

Cf. A178340 (denominators).

Programs

  • Maple
    nm := 15 : eM := Matrix(nm,nm) :
    for n from 0 to nm-1 do for m from 0 to n do eM[n+1,m+1] :=coeff(bernoulli(n,x),x,m) ; end do: for m from n+1 to nm-1 do eM[n+1,m+1] := 0 ; end do: end do:
    eM := LinearAlgebra[MatrixInverse](eM) :
    for n from 1 to nm do for m from 1 to n do printf("%a,", numer(eM[n,m])) ; end do: end do: # R. J. Mathar, Dec 21 2010
  • Mathematica
    max = 13; coes = Table[ PadRight[ CoefficientList[ BernoulliB[n, x], x], max], {n, 0, max-1}]; inv = Inverse[coes]; Table[ Take[inv[[n]], n], {n, 1, max}] // Flatten // Numerator (* Jean-François Alcover, Aug 09 2012 *)
  • PARI
    tabl(nn) = {for (n=0, nn, for (k=0, n, print1(numerator(binomial(n+1,k)/(n+1)), ", ");); print(););} \\ after Tom Copeland comment; Michel Marcus, Jul 25 2015

Formula

"Palindromic:" T(n,m+1) = T(n,n-m). T(n,0)=1.
From Tom Copeland, Jun 18 2015: (Start)
The umbral inverse Bernoulli polynomials are Binv(n,x) = [(1+x)^(n+1)-x^(n+1)]/(n+1) with the e.g.f. e^(t*x) * (e^t-1)/t. (See A074909 for more details.) Therefore, T(n,k) is the numerator of the reduced fraction C(n+1,k)/(n+1) for 0 <= k < (n+1).
The reversed rows are presented as the diagonals of A258820.
T(n,k) = A258820(2n-k,n-k) = A003989(n+1,n+1-k) * n! / [ k! (n+1-k)! ], where A003989(j,k) = gcd(j,k). (End)
From Wolfdieter Lang, Aug 26 2015: (Start)
The following refers to the rational triangle TBinv with entries T(n,k)/A178340(n, m), n >= m >= 0.
The inverse of the Bernoulli triangle TB(n, m) with entries A196838(n,m)/A196839(n,m), n >= m >= 0, is the Sheffer triangle (z/(exp(z)-1),z). Therefore, the inverse triangle TBinv is the Sheffer triangle ((exp(z)-1)/z, z). This means that the e.g.f. of the sequence of column m of TBinv ((exp(x)-1)/x)*x^m/m! for m >= 0.
The e.g.f. of the row polynomials of TBinv, called Binv(n, x) = Sum_{m=0..n} TBinv(n,m)*x^m, is gBinv(z,x) = ((exp(z)-1)/z)*exp(x*z) (of the so-called Appell type).
The e.g.f. of the row sums is gBinv(x,1).
The e.g.f. of the alternating row sums is gBinv(x,-1) = (1 - exp(-x))/x.
The e.g.f. of the a-sequence of this Sheffer triangle is 1, and the e.g.f. of the z-sequence is (exp(x) - x -1)/((exp(x) -1)*x). This is the sequence 1/2, -1/12, 0, 1/120, 0, -1/252, 0, 1/240, 0, -1/132, .... For a- and z-sequences of Sheffer triangles and the corresponding recurrences see A006232.
The convolution property of the row polynomials Binv(n, x) is Binv(n, x+y) = Sum_{k=0..n} binomial(n, k)*Binv(n-k, x)*y^n (or with x and y exchanged).
The row polynomials satisfy (d/dx)Binv(n, x) = n*Binv(n-1, x), with Binv(0, x) = 1 (from Meixner's identity).
(End)

Extensions

Redefined based on reduced fractions by R. J. Mathar, Dec 21 2010
The term umbral was added by Tom Copeland, Aug 25 2015

A339312 Sum over all partitions of n of the GCD of the number of parts and the number of distinct parts.

Original entry on oeis.org

0, 1, 2, 4, 6, 10, 17, 23, 33, 47, 71, 92, 129, 169, 235, 299, 408, 525, 691, 885, 1147, 1427, 1832, 2312, 2878, 3635, 4519, 5631, 7002, 8637, 10514, 13055, 15864, 19396, 23530, 28702, 34746, 42210, 50671, 61224, 73506, 88394, 105447, 126398, 150588, 179075
Offset: 0

Views

Author

Alois P. Heinz, Dec 02 2020

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, p, d) option remember; `if`(n=0, igcd(p, d),
          add(b(n-i*j, i-1, p+j, d+signum(j)), j=`if`(i>1, 0..n/i, n)))
        end:
    a:= n-> b(n$2, 0$2):
    seq(a(n), n=0..50);
  • Mathematica
    b[n_, i_, p_, d_] := b[n, i, p, d] = If[n == 0, GCD[p, d],
         Sum[b[n - i*j, i - 1, p + j, d + Sign[j]],
         {j, If[i > 1, Range[0, n/i], {n}]}]];
    a[n_] := b[n, n, 0, 0];
    a /@ Range[0, 50] (* Jean-François Alcover, Mar 09 2021, after Alois P. Heinz *)

A345416 Table read by upward antidiagonals: Given m, n >= 1, write gcd(m,n) as d = u*m+v*n where u, v are minimal; T(m,n) = v.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jun 19 2021

Keywords

Comments

The gcd is given in A003989, and u is given in A345415. Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when m=n. If we ignore the diagonal, the v table is the transpose of the u table.

Examples

			The gcd table (A003989) begins:
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]
[1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1]
[1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4]
[1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1]
[1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2]
[1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 7, 1, 1]
[1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, 8]
[1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1]
[1, 2, 1, 2, 5, 2, 1, 2, 1, 10, 1, 2, 1, 2, 5, 2]
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1]
[1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12, 1, 2, 3, 4]
...
The u table (A345415) begins:
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[0, 0, -1, 1, -2, 1, -3, 1, -4, 1, -5, 1, -6, 1, -7, 1]
[0, 1, 0, -1, 2, 1, -2, 3, 1, -3, 4, 1, -4, 5, 1, -5]
[0, 0, 1, 0, -1, -1, 2, 1, -2, -2, 3, 1, -3, -3, 4, 1]
[0, 1, -1, 1, 0, -1, 3, -3, 2, 1, -2, 5, -5, 3, 1, -3]
[0, 0, 0, 1, 1, 0, -1, -1, -1, 2, 2, 1, -2, -2, -2, 3]
[0, 1, 1, -1, -2, 1, 0, -1, 4, 3, -3, -5, 2, 1, -2, 7]
[0, 0, -1, 0, 2, 1, 1, 0, -1, -1, -4, -1, 5, 2, 2, 1]
[0, 1, 0, 1, -1, 1, -3, 1, 0, -1, 5, -1, 3, -3, 2, -7]
[0, 0, 1, 1, 0, -1, -2, 1, 1, 0, -1, -1, 4, 3, -1, -3]
[0, 1, -1, -1, 1, -1, 2, 3, -4, 1, 0, -1, 6, -5, -4, 3]
[0, 0, 0, 0, -2, 0, 3, 1, 1, 1, 1, 0, -1, -1, -1, -1]
...
The v table (this entry) begins:
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]
[1, -1, 1, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1]
[1, 1, -1, 1, 1, 1, -1, 0, 1, 1, -1, 0, 1, 1, -1, 0]
[1, -2, 2, -1, 1, 1, -2, 2, -1, 0, 1, -2, 2, -1, 0, 1]
[1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 0, 1, 1, 1, -1]
[1, -3, -2, 2, 3, -1, 1, 1, -3, -2, 2, 3, -1, 0, 1, -3]
[1, 1, 3, 1, -3, -1, -1, 1, 1, 1, 3, 1, -3, -1, -1, 0]
[1, -4, 1, -2, 2, -1, 4, -1, 1, 1, -4, 1, -2, 2, -1, 4]
[1, 1, -3, -2, 1, 2, 3, -1, -1, 1, 1, 1, -3, -2, 1, 2]
[1, -5, 4, 3, -2, 2, -3, -4, 5, -1, 1, 1, -5, 4, 3, -2]
[1, 1, 1, 1, 5, 1, -5, -1, -1, -1, -1, 1, 1, 1, 1, 1]
...
		

Crossrefs

Programs

  • Maple
    mygcd:=proc(a,b) local d,s,t; d := igcdex(a,b,`s`,`t`); [a,b,d,s,t]; end;
    gcd_rowv:=(m,M)->[seq(mygcd(m,n)[5],n=1..M)];
    for m from 1 to 12 do lprint(gcd_rowv(m,16)); od;
  • Mathematica
    T[m_, n_] := Module[{u, v}, MinimalBy[{u, v} /. Solve[u^2 + v^2 <= 26 && u*m + v*n == GCD[m, n], {u, v}, Integers], #.#&][[1, 2]]];
    Table[T[m - n + 1, n], {m, 1, 13}, {n, 1, m}] // Flatten (* Jean-François Alcover, Mar 27 2023 *)

A351961 Square array A(n,k) = A156552(gcd(A005940(1+n), A005940(1+k))), read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 26 2022

Keywords

Comments

The indices run as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), etc. The array is symmetric.

Examples

			The top left corner of the array:
   n=  0  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17
-----|--------------------------------------------------------------
k= 0 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,
   1 | 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,  0,  1,  0,  1,  0,  1,  0,  1,
   2 | 0, 0, 2, 0, 0, 2, 2, 0, 0, 0,  2,  2,  0,  2,  2,  0,  0,  0,
   3 | 0, 1, 0, 3, 0, 1, 0, 3, 0, 1,  0,  3,  0,  1,  0,  3,  0,  1,
   4 | 0, 0, 0, 0, 4, 0, 0, 0, 0, 4,  4,  0,  4,  0,  0,  0,  0,  0,
   5 | 0, 1, 2, 1, 0, 5, 2, 1, 0, 1,  2,  5,  0,  5,  2,  1,  0,  1,
   6 | 0, 0, 2, 0, 0, 2, 6, 0, 0, 0,  2,  2,  0,  6,  6,  0,  0,  0,
   7 | 0, 1, 0, 3, 0, 1, 0, 7, 0, 1,  0,  3,  0,  1,  0,  7,  0,  1,
   8 | 0, 0, 0, 0, 0, 0, 0, 0, 8, 0,  0,  0,  0,  0,  0,  0,  0,  8,
   9 | 0, 1, 0, 1, 4, 1, 0, 1, 0, 9,  4,  1,  4,  1,  0,  1,  0,  1,
  10 | 0, 0, 2, 0, 4, 2, 2, 0, 0, 4, 10,  2,  4,  2,  2,  0,  0,  0,
  11 | 0, 1, 2, 3, 0, 5, 2, 3, 0, 1,  2, 11,  0,  5,  2,  3,  0,  1,
  12 | 0, 0, 0, 0, 4, 0, 0, 0, 0, 4,  4,  0, 12,  0,  0,  0,  0,  0,
  13 | 0, 1, 2, 1, 0, 5, 6, 1, 0, 1,  2,  5,  0, 13,  6,  1,  0,  1,
  14 | 0, 0, 2, 0, 0, 2, 6, 0, 0, 0,  2,  2,  0,  6, 14,  0,  0,  0,
  15 | 0, 1, 0, 3, 0, 1, 0, 7, 0, 1,  0,  3,  0,  1,  0, 15,  0,  1,
  16 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0, 16,  0,
  17 | 0, 1, 0, 1, 0, 1, 0, 1, 8, 1,  0,  1,  0,  1,  0,  1,  0, 17,
		

Crossrefs

Cf. A001477 (main diagonal).
Cf. also A341520, A351960, A351962.

Programs

  • PARI
    up_to = 104; \\ 10439 = binomial(144+1,2)-1
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t); };
    A156552(n) = { my(f = factor(n), p, p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res };
    A351961sq(n,k) = A156552(gcd(A005940(1+n),A005940(1+k)));
    A351961list(up_to) = { my(v = vector(1+up_to), i=0); for(a=0,oo, for(col=0,a, i++; if(i > #v, return(v)); v[i] = A351961sq(col,(a-(col))))); (v); };
    v351961 = A351961list(up_to);
    A351961(n) = v351961[1+n];

Formula

For all x, y >= 0, A(x, y) = A(x, A351960(x,y)) = A(A351960(x,y), y).
Previous Showing 31-40 of 59 results. Next