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.

A054521 Triangle read by rows: T(n,k) = 1 if gcd(n, k) = 1, T(n,k) = 0 otherwise (n >= 1, 1 <= k <= n).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Apr 09 2000

Keywords

Comments

Row sums = phi(n), A000010: (1, 1, 2, 2, 4, 2, 6, ...). - Gary W. Adamson, May 20 2007
Characteristic function of A169581: a(A169581(n)) = 1; a(A169582(n)) = 0. - Reinhard Zumkeller, Dec 02 2009
The function T(n,k) = T(k,n) is defined for k > n but only the values for 1 <= k <= n as a triangular array are listed here.
T(n,k) = |K(n-k|k)| where K(i|j) is the Kronecker symbol. - Peter Luschny, Aug 05 2012
Twice the sum over the antidiagonals, starting with entry T(n-1,1), for n >= 3, is the same as the row n sum (i.e., phi(n): 2*Sum_{k=1..floor(n/2)} T(n-k,k) = phi(n), n >= 3). - Wolfdieter Lang, Apr 26 2013
The number of zeros in the n-th row of the triangle is cototient(n) = A051953(n). - Omar E. Pol, Apr 21 2017
This triangle is the j = 1 sub-triangle of A349221(n,k) = Sum_{j>=1} [k|binomial(n-1,k-1) AND gcd(n,k) = j], n >= 1, 1 <= k <= n, where [] is the Iverson bracket. - Richard L. Ollerton, Dec 14 2021

Examples

			The triangle T(n,k) begins:
  n\k  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 ...
   1:  1
   2:  1  0
   3:  1  1  0
   4:  1  0  1  0
   5:  1  1  1  1  0
   6:  1  0  0  0  1  0
   7:  1  1  1  1  1  1  0
   8:  1  0  1  0  1  0  1  0
   9:  1  1  0  1  1  0  1  1  0
  10:  1  0  1  0  0  0  1  0  1  0
  11:  1  1  1  1  1  1  1  1  1  1  0
  12:  1  0  0  0  1  0  1  0  0  0  1  0
  13:  1  1  1  1  1  1  1  1  1  1  1  1  0
  14:  1  0  1  0  1  0  0  0  1  0  1  0  1  0
  15:  1  1  0  1  0  0  1  1  0  0  1  0  1  1  0
  ... (Reformatted by _Wolfdieter Lang_, Apr 26 2013)
Sums over antidiagonals: n = 3: 2*T(2,1) = 2 = T(3,1) + T(3,2) = phi(3). n = 4: 2*(T(3,1) + T(2,2)) = 2 = phi(4), etc. - _Wolfdieter Lang_, Apr 26 2013
		

Crossrefs

Programs

  • Haskell
    a054521 n k = a054521_tabl !! (n-1) !! (k-1)
    a054521_row n = a054521_tabl !! (n-1)
    a054521_tabl = map (map a063524) a050873_tabl
    a054521_list = concat a054521_tabl
    -- Reinhard Zumkeller, Sep 03 2015
  • Maple
    A054521_row := n -> seq(abs(numtheory[jacobi](n-k,k)),k=1..n);
    for n from 1 to 13 do A054521_row(n) od; # Peter Luschny, Aug 05 2012
  • Mathematica
    T[ n_, k_] := Boole[ n>0 && k>0 && GCD[ n, k] == 1] (* Michael Somos, Jul 17 2011 *)
    T[ n_, k_] := If[ n<1 || k<1, 0, If[ k>n, T[ k, n], If[ k==1, 1, If[ n>k, T[ k, Mod[ n, k, 1]], 0]]]] (* Michael Somos, Jul 17 2011 *)
  • PARI
    {T(n, k) = n>0 && k>0 && gcd(n, k)==1} /* Michael Somos, Jul 17 2011 */
    
  • Sage
    def A054521_row(n): return [abs(kronecker_symbol(n-k,k)) for k in (1..n)]
    for n in (1..13): print(A054521_row(n)) # Peter Luschny, Aug 05 2012
    

Formula

T(n,k) = A063524(A050873(n,k)). - Reinhard Zumkeller, Dec 02 2009, corrected Sep 03 2015
T(n,k) = A054431(n,k) = A054431(k,n). - R. J. Mathar, Jul 21 2016

A057661 a(n) = Sum_{k=1..n} lcm(n,k)/n.

Original entry on oeis.org

1, 2, 4, 6, 11, 11, 22, 22, 31, 32, 56, 39, 79, 65, 74, 86, 137, 92, 172, 116, 151, 167, 254, 151, 261, 236, 274, 237, 407, 221, 466, 342, 389, 410, 452, 336, 667, 515, 550, 452, 821, 452, 904, 611, 641, 761, 1082, 599, 1051, 782, 956, 864, 1379, 821, 1166
Offset: 1

Views

Author

Henry Gould, Oct 15 2000

Keywords

Comments

Sum of numerators of n-th order Farey series (cf. A006842). - Benoit Cloitre, Oct 28 2002
Equals row sums of triangle A143613. - Gary W. Adamson, Aug 27 2008
Equals row sums of triangle A159936. - Gary W. Adamson, Apr 26 2009
Also row sums of triangle A164306. - Reinhard Zumkeller, Aug 12 2009

References

  • H. W. Gould and Temba Shonhiwa, Functions of GCD's and LCM's, Indian J. Math. (Allahabad), 39 (1997), 11-35.
  • H. W. Gould and Temba Shonhiwa, A generalization of Cesaro's function and other results, Indian J. Math. (Allahabad), 39 (1997), 183-194.

Crossrefs

Programs

  • Haskell
    a057661 n = a051193 n `div` n  -- Reinhard Zumkeller, Jun 10 2015
    
  • Magma
    [&+[&+[h: h in [1..d] | GCD(h,d) eq 1]: d in Divisors(n)]: n in [1..100]]; // Jaroslav Krizek, Dec 28 2016
    
  • Mathematica
    Table[Total[Numerator[Range[n]/n]], {n, 55}] (* Alonso del Arte, Oct 07 2011 *)
    f[p_, e_] := (p^(2*e + 1) + 1)/(p + 1); a[n_] := (1 + Times @@ f @@@ FactorInteger[n])/2; Array[a, 100] (* Amiram Eldar, Apr 26 2023 *)
  • PARI
    a(n)=sum(k=1,n,lcm(n,k))/n \\ Charles R Greathouse IV, Feb 07 2017
    
  • Python
    from math import lcm
    def A057661(n): return sum(lcm(n,k)//n for k in range(1,n+1)) # Chai Wah Wu, Aug 24 2023
    
  • Python
    from math import prod
    from sympy import factorint
    def A057661(n): return 1+prod((p**((e<<1)+1)+1)//(p+1) for p,e in factorint(n).items())>>1 # Chai Wah Wu, Aug 05 2024

Formula

a(n) = (1+A057660(n))/2.
a(n) = A051193(n)/n.
a(n) = Sum_{d|n} psi(d), where psi(m) = is the sum of totatives of m (A023896). - Jaroslav Krizek, Dec 28 2016
a(n) = Sum_{i=1..n} denominator(n/i). - Wesley Ivan Hurt, Feb 26 2017
G.f.: x/(2*(1 - x)) + (1/2)*Sum_{k>=1} k*phi(k)*x^k/(1 - x^k), where phi() is the Euler totient function (A000010). - Ilya Gutkovskiy, Aug 31 2017
If p is prime, then a(p) = T(p-1) + 1 = p(p-1)/2 + 1, where T(n) = n(n+1)/2 is the n-th triangular number (A000217). - David Terr, Feb 10 2019
Sum_{k=1..n} a(k) ~ zeta(3) * n^3 / Pi^2. - Vaclav Kotesovec, May 29 2021
Dirichlet g.f.: zeta(s)*(1 + zeta(s-2)/zeta(s-1))/2 (Franco, 2019). - Amiram Eldar, Mar 26 2022

Extensions

More terms from James Sellers, Oct 16 2000

A054531 Triangular array T read by rows: T(n,k) = n/gcd(n,k) (n >= 1, 1 <= k <= n).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Apr 09 2000

Keywords

Comments

Sum of n-th row = A057660(n). - Reinhard Zumkeller, Aug 12 2009
Read as a linear sequence, this is conjectured to be the length of the shortest cycle of pebble-moves among the partitions of n (cf. A201144). - Andrew V. Sutherland, Nov 27 2011
The triangle of fractions A226314(i,j)/A054531(i,j) is an efficient way to enumerate the rationals [Fortnow]. - N. J. A. Sloane, Jun 09 2013

Examples

			Triangle begins
   1;
   2,  1;
   3,  3,  1;
   4,  2,  4,  1;
   5,  5,  5,  5,  1;
   6,  3,  2,  3,  6,  1;
   7,  7,  7,  7,  7,  7,  1;
   8,  4,  8,  2,  8,  4,  8,  1;
   9,  9,  3,  9,  9,  3,  9,  9,  1;
  10,  5, 10,  5,  2,  5, 10,  5, 10,  1;
  11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  1;
  12,  6,  4,  3, 12,  2, 12,  3,  4,  6, 12,  1;
  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  1;
		

Crossrefs

Cf. A050873, A164306, A226314, A277227 (row reversed, k=0..n-1).

Programs

  • Haskell
    a054531 n k = div n $ gcd n k
    a054531_row n = a054531_tabl !! (n-1)
    a054531_tabl = zipWith (\u vs -> map (div u) vs) [1..] a050873_tabl
    -- Reinhard Zumkeller, Jun 10 2013
    
  • Mathematica
    Table[n/GCD[n,k], {n,1,10}, {k,1,n}]//Flatten (* G. C. Greubel, Sep 13 2017 *)
  • PARI
    for(n=1,10, for(k=1,n, print1(n/gcd(n,k), ", "))) \\ G. C. Greubel, Sep 13 2017

A144437 Period 3: repeat [3, 3, 1].

Original entry on oeis.org

3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3
Offset: 1

Views

Author

Paul Curtz, Oct 05 2008

Keywords

Comments

The sequence is generated from numerators in the energy differences of the hydrogen spectrum: A005563(1), A061037(4), A061039(6), A061041(8), A061043(10), A061045(12), A061047(14), A061049(16), ...
Conjecture: a(n) is the separatix. See A045944.
Also the decimal expansion of the constant 3310/999. - R. J. Mathar, May 21 2009
Continued fraction expansion of A171417.
Greatest common divisor of (n+1)^2-1 and (n+1)^2+2. - Bruno Berselli, Mar 08 2017

Crossrefs

Numerators in the energy differences of the hydrogen spectrum: A005563(1), A061037(4), A061039(6), A061041(8), A061043(10), A061045(12), A061047(14), A061049(16), ...

Programs

Formula

a(n) = (7-4*cos(2*Pi*n/3))/3. - Jaume Oliver Lafont, Nov 23 2008
G.f.: x*(3 + 3*x + x^2)/((1 - x)*(1 + x + x^2)). - R. J. Mathar, May 21 2009
a(n) = 3/gcd(n,3). - Reinhard Zumkeller, Oct 30 2009
a(n) = denominator(n^k/3), where k>0 is an integer. - Enrique Pérez Herrero, Oct 05 2011
a(n) = gcd(T(n+1), T(2)) = A256095(n+1, 2), with the triangular numbers T = A000217, for n >= 1. - Wolfdieter Lang, Mar 17 2015
a(n) = a(n-3) for n>3; a(n) = A169609(n) for n>0. - Wesley Ivan Hurt, Jul 02 2016
E.g.f.: (1/3)*(7*exp(x) - 4*exp(-x/2)*cos(sqrt(3)*x/2) - 3). - G. C. Greubel, Aug 24 2017
From Nicolas Bělohoubek, Nov 11 2021: (Start)
a(n) = 9/(a(n-2)*a(n-1)).
a(n) = 7 - a(n-2) - a(n-1). See also A052901 or A069705. (End)

Extensions

Edited by R. J. Mathar, May 21 2009

A051537 Triangle read by rows: T(i,j) = lcm(i,j)/gcd(i,j) for 1 <= j <= i.

Original entry on oeis.org

1, 2, 1, 3, 6, 1, 4, 2, 12, 1, 5, 10, 15, 20, 1, 6, 3, 2, 6, 30, 1, 7, 14, 21, 28, 35, 42, 1, 8, 4, 24, 2, 40, 12, 56, 1, 9, 18, 3, 36, 45, 6, 63, 72, 1, 10, 5, 30, 10, 2, 15, 70, 20, 90, 1, 11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 1, 12, 6, 4, 3, 60, 2, 84, 6, 12, 30, 132, 1, 13, 26, 39
Offset: 1

Views

Author

N. J. A. Sloane and Amarnath Murthy, May 10 2002

Keywords

Comments

From Robert G. Wilson v, May 10 2002: (Start)
The first term of the k-th row is k. The first leading diagonal contains all 1's. The second leading diagonal contains twice the triangular numbers = n*(n-1).
For p prime, the sum of the p-th row is (p^3 - p^2 + 2)/2.
Proof: The p-th row is p, 2*p, 3*p, ..., (p-2)*p, (p-1)*p, 1. The sum of the row = p*(1 + 2 + 3 + ... + (p-2) + (p-1)) + 1 = p*(p-1)*p/2 + 1 = (p^3 - p^2 + 2)/2. (End) [Edited by Petros Hadjicostas, May 27 2020]
In the square array where T(i,j) = T(j,i), the natural extension of the triangle, each set of rows and columns with common indices [d1, d2, ..., ds] define a group multiplication table on their grid, if the d1, d2, ..., ds are the set of divisors of a squarefree number [A. Jorza]. - R. J. Mathar, May 03 2007
T(n,k) is the minimum number of squares necessary to fill a rectangle with sides of length n and k. - Stefano Spezia, Oct 06 2018

Examples

			Triangle T(n,k) (with rows n >= 1 and columns k = 1..n) begins
  1;
  2,  1;
  3,  6,  1;
  4,  2, 12,  1;
  5, 10, 15, 20,  1;
  6,  3,  2,  6, 30,  1;
  7, 14, 21, 28, 35, 42,  1;
  8,  4, 24,  2, 40, 12, 56,  1;
  ...
		

Crossrefs

Diagonals give A002378, A070260, A070261, A070262.
Row sums give A056789.

Programs

  • GAP
    Flat(List([1..13],n->List([1..n],k->Lcm(n,k)/Gcd(n,k)))); # Muniru A Asiru, Oct 06 2018
    
  • Haskell
    a051537 n k = a051537_tabl !! (n-1) !! (k-1)
    a051537_row n = a051537_tabl !! (n-1)
    a051537_tabl = zipWith (zipWith div) a051173_tabl a050873_tabl
    -- Reinhard Zumkeller, Jul 07 2013
    
  • Magma
    /* As triangle */ [[Lcm(n,k)/Gcd(n,k): k in [1..n]]: n in [1.. 15]]; // Vincenzo Librandi, Oct 07 2018
  • Maple
    T:=proc(n,k) n*k/gcd(n,k)^2; end proc: seq(seq(T(n,k),k=1..n),n=1..13); # Muniru A Asiru, Oct 06 2018
  • Mathematica
    Flatten[ Table[ LCM[i, j] / GCD[i, j], {i, 1, 13}, {j, 1, i}]]
    T[n_,k_]:=n*k/GCD[n,k]^2; Flatten[Table[T[n,k],{k,1,13},{n,1,k}]] (* Stefano Spezia, Oct 06 2018 *)

Formula

T(n,k) = A054531(n,k)*A164306(n,k). - Reinhard Zumkeller, Oct 30 2009
T(n,k) = A051173(n,k) / A050873(n,k). - Reinhard Zumkeller, Jul 07 2013
T(n,k) = n*k/gcd(n,k)^2. - Stefano Spezia, Oct 06 2018

Extensions

More terms from Robert G. Wilson v, May 10 2002

A167192 Triangle read by rows: T(n,k) = (n-k)/gcd(n,k), 1 <= k <= n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Oct 30 2009

Keywords

Examples

			The triangle T(n,k) begins:
n\k   1   2   3   4  5  6  7  8  9 10 11 12 13  14  15 ...
1:    0
2:    1   0
3:    2   1   0
4:    3   1   1   0
5:    4   3   2   1  0
6:    5   2   1   1  1  0
7:    6   5   4   3  2  1  0
8:    7   3   5   1  3  1  1  0
9:    8   7   2   5  4  1  2  1  0
10:   9   4   7   3  1  2  3  1  1  0
11:  10   9   8   7  6  5  4  3  2  1  0
12:  11   5   3   2  7  1  5  1  1  1  1  0
13:  12  11  10   9  8  7  6  5  4  3  2  1  0
14:  13   6  11   5  9  4  1  3  5  2  3  1  1   0
15:  14  13   4  11  2  3  8  7  2  1  4  1  2   1   0
- _Wolfdieter Lang_, Feb 20 2013
		

Crossrefs

Programs

  • Mathematica
    Flatten[Table[(n-k)/GCD[n,k],{n,20},{k,n}]] (* Harvey P. Dale, Nov 27 2015 *)
  • PARI
    for(n=1,10, for(k=1,n, print1((n-k)/gcd(n,k), ", "))) \\ G. C. Greubel, Sep 13 2017

Formula

T(n,k) = (n-k)/gcd(n,k), 1 <= k <= n.
T(n,k) = A025581(n,k)/A050873(n,k);
T(n,1) = A001477(n-1);
T(n,2) = A026741(n-2) for n > 1;
T(n,3) = A051176(n-3) for n > 2;
T(n,4) = A060819(n-4) for n > 4;
T(n,n-3) = A144437(n) for n > 3;
T(n,n-2) = A000034(n) for n > 2;
T(n,n-1) = A000012(n);
T(n,n) = A000004(n).

A343762 a(1) = 1; a(n) = -Sum_{k=1..n} a(k/gcd(n,k)).

Original entry on oeis.org

1, -2, 0, -3, 3, -5, 5, -12, 8, -12, 16, -31, 31, -55, 23, -99, 131, -184, 184, -389, 157, -528, 760, -1171, 800, -2058, 1235, -3248, 4442, -5566, 5566, -13461, 7433, -20534, 18290, -30439, 38711, -77429, 46895, -105973, 136507, -187059, 187059, -441337, 185384, -632122, 888075
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 28 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = -Sum[a[k/GCD[n, k]], {k, 1, n}]; Table[a[n], {n, 1, 47}]
    a[1] = 1; a[n_] := a[n] = -Sum[Sum[If[GCD[k, d] == 1, a[k], 0], {k, 1, d}], {d, Divisors[n]}]; Table[a[n], {n, 1, 47}]

Formula

a(1) = 1; a(n) = -Sum_{d|n} Sum_{k=1..d, gcd(d,k) = 1} a(k).
a(n) = -a(n-1) if n belongs to A006512.
Showing 1-7 of 7 results.