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-10 of 32 results. Next

A280133 Partial products of A057661 (Sum_{d|n} psi(d)).

Original entry on oeis.org

1, 2, 8, 48, 528, 5808, 127776, 2811072, 87143232, 2788583424, 156160671744, 6090266198016, 481131029643264, 31273516926812160, 2314240252584099840, 199024661722232586240, 27266378655945864314880, 2508506836347019516968960, 431463175851687356918661120
Offset: 1

Views

Author

Jaroslav Krizek, Dec 27 2016

Keywords

Comments

psi(n) is the sum of the totatives of n (A023896).

Crossrefs

Cf. A000010, A057661, A232533 (partial sums of A057661), A280132 (partial products of A029940).

Programs

  • Magma
    [&*[&+[&+[h: h in [1..d] | GCD(h,d) eq 1]: d in Divisors(k)]: k in [1..n]]: n in [1..1000]]
  • Mathematica
    FoldList[Times[#1, #2] &, Array[Sum[Total@ Select[Range@ d, CoprimeQ[#, d] &], {d, Divisors@ #}] &, 19]] (* Michael De Vlieger, Dec 27 2016 *)

Formula

a(n) = Product_{i=1..n} A057661(i).

A057660 a(n) = Sum_{k=1..n} n/gcd(n,k).

Original entry on oeis.org

1, 3, 7, 11, 21, 21, 43, 43, 61, 63, 111, 77, 157, 129, 147, 171, 273, 183, 343, 231, 301, 333, 507, 301, 521, 471, 547, 473, 813, 441, 931, 683, 777, 819, 903, 671, 1333, 1029, 1099, 903, 1641, 903, 1807, 1221, 1281, 1521, 2163, 1197, 2101, 1563, 1911, 1727
Offset: 1

Views

Author

Henry Gould, Oct 15 2000

Keywords

Comments

Also sum of the orders of the elements in a cyclic group with n elements, i.e., row sums of A054531. - Avi Peretz (njk(AT)netvision.net.il), Mar 31 2001
Also inverse Moebius transform of EulerPhi(n^2), A002618.
Sequence is multiplicative with a(p^e) = (p^(2*e+1)+1)/(p+1). Example: a(10) = a(2)*a(5) = 3*21 = 63.
a(n) is the number of pairs (a, b) such that the equation ax = b is solvable in the ring (Zn, +, x). See the Mathematical Reflections link. - Michel Marcus, Jan 07 2017
From Jake Duzyk, Jun 06 2023: (Start)
These are the "contraharmonic means" of the improper divisors of square integers (inclusive of 1 and the square integer itself).
Permitting "Contraharmonic Divisor Numbers" to be defined analogously to Øystein Ore's Harmonic Divisor Numbers, the only numbers for which there exists an integer contraharmonic mean of the divisors are the square numbers, and a(n) is the n-th integer contraharmonic mean, expressible also as the sum of squares of divisors of n^2 divided by the sum of divisors of n^2. That is, a(n) = sigma_2(n^2)/sigma(n^2).
(a(n) = A001157(k)/A000203(k) where k is the n-th number such that A001157(k)/A000203(k) is an integer, i.e., k = n^2.)
This sequence is an analog of A001600 (Harmonic means of divisors of harmonic numbers) and A102187 (Arithmetic means of divisors of arithmetic numbers). (End)

References

  • David M. Burton, Elementary Number Theory, Allyn and Bacon Inc., Boston MA, 1976, p. 152.
  • H. W. Gould and Temba Shonhiwa, Functions of GCD's and LCM's, Indian J. Math. (Allahabad), Vol. 39, No. 1 (1997), pp. 11-35.
  • H. W. Gould and Temba Shonhiwa, A generalization of Cesaro's function and other results, Indian J. Math. (Allahabad), Vol. 39, No. 2 (1997), pp. 183-194.

Crossrefs

Programs

  • Haskell
    a057660 n = sum $ map (div n) $ a050873_row n
    -- Reinhard Zumkeller, Nov 25 2013
    
  • Mathematica
    Table[ DivisorSigma[ 2, n^2 ] / DivisorSigma[ 1, n^2 ], {n, 1, 128} ]
    Table[Total[Denominator[Range[n]/n]], {n, 55}] (* Alonso del Arte, Oct 07 2011 *)
    f[p_, e_] := (p^(2*e + 1) + 1)/(p + 1); a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Nov 21 2020 *)
  • PARI
    a(n)=if(n<1,0,sumdiv(n,d,d*eulerphi(d)))
    
  • PARI
    a(n)=sumdivmult(n,d, eulerphi(d)*d) \\ Charles R Greathouse IV, Sep 09 2014
    
  • Python
    from math import gcd
    def A057660(n): return sum(n//gcd(n,k) for k in range(1,n+1)) # Chai Wah Wu, Aug 24 2023
    
  • Python
    from math import prod
    from sympy import factorint
    def A057660(n): return prod((p**((e<<1)+1)+1)//(p+1) for p,e in factorint(n).items()) # Chai Wah Wu, Aug 05 2024

Formula

a(n) = Sum_{d|n} d*A000010(d) = Sum_{d|n} d*A054522(n,d), sum of d times phi(d) for all divisors d of n, where phi is Euler's phi function.
a(n) = sigma_2(n^2)/sigma_1(n^2) = A001157(A000290(n))/A000203(A000290(n)) = A001157(A000290(n))/A065764(n). - Labos Elemer, Nov 21 2001
a(n) = Sum_{d|n} A000010(d^2). - Enrique Pérez Herrero, Jul 12 2010
a(n) <= (n-1)*n + 1, with equality if and only if n is noncomposite. - Daniel Forgues, Apr 30 2013
G.f.: Sum_{n >= 1} n*phi(n)*x^n/(1 - x^n) = x + 3*x^2 + 7*x^3 + 11*x^4 + .... Dirichlet g.f.: sum {n >= 1} a(n)/n^s = zeta(s)*zeta(s-2)/zeta(s-1) for Re s > 3. Cf. A078747 and A176797. - Peter Bala, Dec 30 2013
a(n) = Sum_{i=1..n} numerator(n/i). - Wesley Ivan Hurt, Feb 26 2017
L.g.f.: -log(Product_{k>=1} (1 - x^k)^phi(k)) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, May 21 2018
From Richard L. Ollerton, May 10 2021: (Start)
a(n) = Sum_{k=1..n} lcm(n,k)/k.
a(n) = Sum_{k=1..n} gcd(n,k)*phi(gcd(n,k))/phi(n/gcd(n,k)). (End)
From Vaclav Kotesovec, Jun 13 2021: (Start)
Sum_{k=1..n} a(k)/k ~ 3*zeta(3)*n^2/Pi^2.
Sum_{k=1..n} k^2/a(k) ~ A345294 * n.
Sum_{k=1..n} k*A000010(k)/a(k) ~ A345295 * n. (End)
Sum_{k=1..n} a(k) ~ 2*zeta(3)*n^3/Pi^2. - Vaclav Kotesovec, Jun 10 2023

Extensions

More terms from James Sellers, Oct 16 2000

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

Original entry on oeis.org

1, 4, 12, 24, 55, 66, 154, 176, 279, 320, 616, 468, 1027, 910, 1110, 1376, 2329, 1656, 3268, 2320, 3171, 3674, 5842, 3624, 6525, 6136, 7398, 6636, 11803, 6630, 14446, 10944, 12837, 13940, 15820, 12096, 24679, 19570, 21450, 18080, 33661, 18984, 38872, 26884
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A000010, A018804, A051173 (triangle whose n-th row sum is a(n)), A057660, A057661.

Programs

  • Haskell
    a051193 = sum . a051173_row  -- Reinhard Zumkeller, Feb 11 2014
    
  • Maple
    a:=n->add(ilcm( n, j ), j=1..n): seq(a(n), n=1..50); # Zerinvary Lajos, Nov 07 2006
  • Mathematica
    Table[Sum[LCM[k, n], {k, 1, n}], {n, 1, 39}] (* Geoffrey Critzer, Feb 16 2015 *)
    f[p_, e_] := (p^(2*e + 1) + 1)/(p + 1); a[n_] := 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)); \\ Michel Marcus, Feb 06 2015
    
  • Python
    from math import prod
    from sympy import factorint
    def A051193(n): return n*(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) = n*(1+Sum_{d|n} d*phi(d))/2 = n*(1+A057660(n))/2 = n*A057661(n). - Vladeta Jovovic, Jun 21 2002
G.f.: x*f'(x), where f(x) = x/(2*(1 - x)) + (1/2)*Sum_{k>=1} k*phi(k)*x^k/(1 - x^k) and phi() is the Euler totient function (A000010). - Ilya Gutkovskiy, Aug 31 2017
Sum_{k=1..n} a(k) ~ 3 * zeta(3) * n^4 / (4*Pi^2). - Vaclav Kotesovec, May 29 2021

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

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 12 2009

Keywords

Comments

Also the gcd of the coefficients of the partition polynomials (called 'De Moivre polynomials' by O'Sullivan, see link, Theorem 4.1). - Peter Luschny, Sep 20 2022

Examples

			From _Indranil Ghosh_, Feb 14 2017: (Start)
Triangle begins:
1,
1, 1,
1, 2, 1,
1, 1, 3, 1,
1, 2, 3, 4, 1,
1, 1, 1, 2, 5, 1,
1, 2, 3, 4, 5, 6, 1,
. . .
T(4,3) = 3 / gcd(3,4) = 3 / 1 = 3. (End)
		

Crossrefs

Programs

  • Maple
    seq(seq(k / igcd(n, k), k = 1..n), n = 1..13); # Peter Luschny, Sep 20 2022
  • Mathematica
    Flatten[Table[k/GCD[k,n],{n,20},{k,n}]] (* Harvey P. Dale, Jul 21 2013 *)
  • PARI
    for(n=0,10, for(k=1,n, print1(k/gcd(k,n), ", "))) \\ G. C. Greubel, Sep 13 2017

Formula

Sum of n-th row = A057661(n).
T(n, k) = A051537(n, k)/A054531(n, k). - Reinhard Zumkeller, Oct 30 2009

A073089 a(n) = (1/2)*(4n - 3 - Sum_{k=1..n} A007400(k)).

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Aug 18 2002

Keywords

Comments

From Joerg Arndt, Oct 28 2013: (Start)
Sequence is (essentially) obtained by complementing every other term of A014577.
Turns (by 90 degrees) of a curve similar to the Heighway dragon which can be rendered as follows: [Init] Set n=0 and direction=0. [Draw] Draw a unit line (in the current direction). Turn left/right if a(n) is zero/nonzero respectively. [Next] Set n=n+1 and goto (draw).
See the linked pdf files for two renderings of the curve. (End)

Examples

			From _Paul D. Hanna_, Oct 19 2012: (Start)
Let F(x) = x + 1/x + 1/x^3 + 1/x^7 + 1/x^15 + 1/x^31 +...+ 1/x^(2^n-1) +...
then F(x) = x + 1/(x + 1/(-x + 1/(-x + 1/(-x + 1/(x + 1/(x + 1/(-x + 1/(-x + 1/(x + 1/(-x + 1/(-x + 1/(x + 1/(x + 1/(x + 1/(-x + 1/(-x + 1/(x + 1/(-x + 1/(-x + 1/(-x + 1/(x +...+ 1/((-1)^a(n)*x +...)))))))))))))))))))))),
a continued fraction in which the partial quotients equal (-1)^a(n)*x.  (End)
		

Crossrefs

Cf. A007400, A073088 (the sum part here), A123725.

Programs

  • PARI
    a(n)=if(n<2,0,if(n%8==1,a((n+1)/2),[1,-1,0,1,1,1,0,0,1,-1,0,1,1,0,0,0][(n%16)+1])) \\ Ralf Stephan
    
  • PARI
    /* Using the Continued Fraction, Print 2^N terms of this sequence: */
    {N=10;CF=contfrac(x+sum(n=1,N,1/x^(2^n-1)),2^N);for(n=1,2^N,print1((1-CF[n]/x)/2,", "))} \\ Paul D. Hanna, Oct 19 2012
    
  • PARI
    a(n) = { if ( n<=1, return(0)); n-=1; my(v=2^valuation(n,2) ); return( (0==bitand(n, v<<1)) != (v%2) ); } \\ Joerg Arndt, Oct 28 2013

Formula

Recurrence: a(1) = a(4n+2) = a(8n+7) = a(16n+13) = 0, a(4n) = a(8n+3) = a(16n+5) = 1, a(8n+1) = a(4n+1).
G.f.: The following series has a simple continued fraction expansion:
x + Sum_{n>=1} 1/x^(2^n-1) = [x; x, -x, -x, -x, x, ..., (-1)^a(n)*x, ...]. - Paul D. Hanna, Oct 19 2012
a(n) = A014577(n-2) + A056594(n). Conjecture: a(n) = (1 + (-1)^A057661(n - 1))/2 for all n > 1. - Velin Yanev, Feb 01 2021

A332619 a(n) = Sum_{d|n} lcm(d, n/d) / d.

Original entry on oeis.org

1, 3, 4, 6, 6, 12, 8, 12, 11, 18, 12, 24, 14, 24, 24, 23, 18, 33, 20, 36, 32, 36, 24, 48, 27, 42, 32, 48, 30, 72, 32, 45, 48, 54, 48, 66, 38, 60, 56, 72, 42, 96, 44, 72, 66, 72, 48, 92, 51, 81, 72, 84, 54, 96, 72, 96, 80, 90, 60, 144, 62, 96, 88, 88, 84, 144, 68, 108, 96, 144
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 17 2020

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> add(d/igcd(d, n/d), d=numtheory[divisors](n)):
    seq(a(n), n=1..80);  # Alois P. Heinz, Feb 17 2020
  • Mathematica
    Table[Sum[LCM[d, n/d]/d, {d, Divisors[n]}], {n, 1, 70}]
    f[p_, e_] := If[EvenQ[e], (p^(e + 2) - 1)/(p^2 - 1) + e/2, (p^(e + 2) - p)/(p^2 - 1) + (e + 1)/2]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Dec 05 2022 *)
  • PARI
    A332619(n) = sumdiv(n,d,lcm(d,n/d)/d); \\ Antti Karttunen, Nov 12 2021

Formula

a(n) = Sum_{d|n} d / gcd(d, n/d).
From Amiram Eldar, Dec 05 2022: (Start)
Multiplicative with a(p^e) = (p^(e+2)-1)/(p^2-1) + e/2 if e is even, and (p^(e+2)-p)/(p^2-1) + (e + 1)/2 if e is odd.
Sum_{k=1..n} a(k) ~ c * n^2, where c = 7*zeta(6)/(8*zeta(5)) = 0.740543... . (End)

A332654 a(n) = Sum_{k=1..n} (k/gcd(n, k))^2.

Original entry on oeis.org

1, 2, 6, 12, 31, 33, 92, 96, 165, 172, 386, 239, 651, 499, 656, 776, 1497, 846, 2110, 1262, 1903, 2037, 3796, 1867, 4181, 3408, 4530, 3673, 7715, 3183, 9456, 6232, 7761, 7754, 10062, 6248, 16207, 10889, 12980, 9906, 22141, 9308, 25586, 15027, 17075, 19483, 33512, 14851
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 18 2020

Keywords

Comments

Inverse Moebius transform of A053818.

Crossrefs

Programs

  • Magma
    [&+[(k div Gcd(n,k))^2:k in [1..n]]:n in [1..50]]; // Marius A. Burtea, Feb 18 2020
  • Mathematica
    Table[Sum[(k/GCD[n, k])^2, {k, 1, n}], {n, 1, 48}]
    Table[Sum[Sum[If[GCD[k, d] == 1, k^2, 0], {k, 1, d}], {d, Divisors[n]}], {n, 1, 48}]

Formula

a(n) = Sum_{k=1..n} (lcm(n, k)/n)^2.
a(n) = Sum_{d|n} Sum_{k=1..d, gcd(k, d) = 1} k^2.

A287006 a(1) = 1; a(n+1) = Sum_{k=1..n} lcm(a(k),a(n))/a(n).

Original entry on oeis.org

1, 1, 2, 3, 5, 8, 12, 12, 13, 45, 36, 32, 86, 120, 75, 177, 250, 315, 281, 1194, 726, 925, 2695, 2218, 5776, 6808, 6632, 8383, 28449, 34934, 53325, 69653, 153540, 107261, 371925, 241534, 749726, 870493, 1460599, 2623154, 3576448, 4841995, 9911297, 15119248, 19818816, 20257600, 7481107, 80326829
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 31 2017

Keywords

Examples

			a(1) = 1;
a(2) = lcm(a(1),a(1))/a(1) = lcm(1,1)/1 = 1;
a(3) = lcm(a(1),a(2))/a(2) + lcm(a(2),a(2))/a(2) = lcm(1,1)/1 + lcm(1,1)/1 = 2;
a(4) = lcm(a(1),a(3))/a(3) + lcm(a(2),a(3))/a(3) + lcm(a(3),a(3))/a(3) = lcm(1,2)/2 + lcm(1,2)/2 + lcm(2,2)/2 = 3, etc.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = Sum[LCM[a[k - 1], a[n - 1]]/a[n - 1], {k, 2, n}]; Table[a[n], {n, 48}]
    a[1] = 1; a[n_] := a[n] = Sum[a[k - 1]/GCD[a[k - 1], a[n - 1]], {k, 2, n}]; Table[a[n], {n, 48}]

Formula

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

A332049 a(n) = (1/2) * Sum_{d|n, d > 1} d * phi(d).

Original entry on oeis.org

0, 1, 3, 5, 10, 10, 21, 21, 30, 31, 55, 38, 78, 64, 73, 85, 136, 91, 171, 115, 150, 166, 253, 150, 260, 235, 273, 236, 406, 220, 465, 341, 388, 409, 451, 335, 666, 514, 549, 451, 820, 451, 903, 610, 640, 760, 1081, 598, 1050, 781, 955, 863, 1378, 820, 1165
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 06 2020

Keywords

Comments

Sum of numerators of the reduced fractions 1/n, ..., (n-1)/n. Note that if n is a prime p this is p*(p-1)/2 as all fractions are already reduced. For 1/n, ..., n/n, see A057661.

Examples

			For n = 5, fractions are 1/5, 2/5, 3/5, 4/5, sum of numerators is 10.
For n = 8, fractions are 1/8, 1/4, 3/8, 1/2, 5/8, 3/4, 7/8, sum of numerators is 21.
		

Crossrefs

Programs

  • Haskell
    toNums a = fmap (numerator . (% a))
    toNumList a = toNums a [1..(a-1)]
    sumList = sum . toNumList <$> [2..200]
  • Magma
    [0] cat [(1/2)*&+[ d*EulerPhi(d):d in Set(Divisors(n)) diff {1}]:n in [2..60]]; // Marius A. Burtea, Feb 07 2020
    
  • Maple
    N:= 100: # for a(1)..a(N)
    V:= Vector(N):
    for d from 2 to N do
      v:= d*numtheory:-phi(d)/2;
      R:= [seq(i,i=d..N,d)];
      V[R]:= V[R] +~ v
    od:
    convert(V,list); # Robert Israel, Feb 07 2020
  • Mathematica
    Table[(1/2) Sum[If[d > 1, d EulerPhi[d], 0], {d, Divisors[n]}], {n, 1, 55}]
    nmax = 55; CoefficientList[Series[(1/2) Sum[EulerPhi[k^2] x^k/(1 - x^k), {k, 2, nmax}], {x, 0, nmax}], x] // Rest
    Table[Sum[k/GCD[n, k], {k, 1, n - 1}], {n, 1, 55}]
    Table[(DivisorSigma[2, n^2] - DivisorSigma[1, n^2])/(2 DivisorSigma[1, n^2]), {n, 1, 55}]
  • PARI
    a(n) = sumdiv(n, d, if (d>1, d*eulerphi(d)))/2; \\ Michel Marcus, Feb 07 2020
    

Formula

G.f.: (1/2) * Sum_{k>=2} phi(k^2) * x^k / (1 - x^k).
a(n) = Sum_{k=1..n-1} k / gcd(n,k).
a(n) = (sigma_2(n^2) - sigma_1(n^2)) / (2 * sigma_1(n^2)).
a(n) = Sum_{d|n, d > 1} A023896(d).
a(n) = A057661(n) - 1 = (A057660(n) - 1) / 2.

A332653 a(n) = (1/n) * Sum_{k=1..n} n^(k/gcd(n, k)).

Original entry on oeis.org

1, 2, 5, 19, 157, 1306, 19609, 266372, 5321721, 101001214, 2593742461, 61920391842, 1941507093541, 56984643437138, 2076518238897649, 72340172854919941, 3041324492229179281, 121440691499123469858, 5784852794328402307381, 262799364106291328009626
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 18 2020

Keywords

Crossrefs

Programs

  • Magma
    [(1/n)*&+[n^(k div Gcd(n,k)):k in [1..n]]:n in [1..21]]; // Marius A. Burtea, Feb 18 2020
  • Mathematica
    Table[(1/n) Sum[n^(k/GCD[n, k]), {k, 1, n}], {n, 1, 20}]
    Table[Sum[Sum[If[GCD[k, d] == 1, n^(k - 1), 0], {k, 1, d}], {d, Divisors[n]}], {n, 1, 20}]

Formula

a(n) = (1/n) * Sum_{k=1..n} n^(lcm(n, k)/n).
a(n) = Sum_{d|n} Sum_{k=1..d, gcd(k, d) = 1} n^(k-1).
a(n) = A332652(n) / n.
Showing 1-10 of 32 results. Next