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

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

Original entry on oeis.org

1, 1, 5, 10, 30, 26, 91, 84, 159, 140, 385, 196, 650, 406, 620, 680, 1496, 654, 2109, 1080, 1806, 1650, 3795, 1544, 4150, 2756, 4365, 3164, 7714, 2360, 9455, 5456, 7370, 6256, 9940, 5196, 16206, 8778, 12324, 8560, 22140, 6972, 25585
Offset: 1

Views

Author

N. J. A. Sloane, Apr 07 2000

Keywords

Comments

Equals row sums of triangle A143612. - Gary W. Adamson, Aug 27 2008
a(n) = A175505(n) * A023896(n) / A175506(n). For number n >= 1 holds B(n) = a(n) / A023896(n) = A175505(n) / A175506(n), where B(n) = antiharmonic mean of numbers k such that GCD(k, n) = 1 for k < n. - Jaroslav Krizek, Aug 01 2010
n does not divide a(n) iff n is a term in A316860, that is, either n is a power of 2 or n is a multiple of 3 and no prime factor of n is congruent to 1 mod 3. - Jianing Song, Jul 16 2018

References

  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 48, problem 15, the function phi_2(n).
  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 199, #2.

Crossrefs

Programs

  • Maple
    A053818 := proc(n)
        local a,k;
        a := 0 ;
        for k from 1 to n do
            if igcd(k,n) = 1 then
                a := a+k^2 ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Sep 26 2013
  • Mathematica
    a[n_] := Plus @@ (Select[ Range@n, GCD[ #, n] == 1 &]^2); Array[a, 43] (* Robert G. Wilson v, Jul 01 2010 *)
    a[1] = 1; a[n_] := Module[{f = FactorInteger[n], p, e}, p = f[[;; , 1]]; e = f[[;; , 2]]; (n^2/3) * Times @@ ((p - 1)*p^(e - 1)) + (n/6) * Times @@ (1 - p)]; Array[a, 100] (* Amiram Eldar, Dec 03 2023 *)
  • PARI
    a(n) = sum(k=1, n, k^2*(gcd(n,k) == 1)); \\ Michel Marcus, Jan 30 2016
    
  • PARI
    a(n) = {my(f = factor(n)); if(n == 1, 1, (n^2/3) * eulerphi(f) + (n/6) * prod(i = 1, #f~, 1 - f[i, 1]));} \\ Amiram Eldar, Dec 03 2023

Formula

If n = p_1^e_1 * ... *p_r^e_r then a(n) = n^2*phi(n)/3 + (-1)^r*p_1*..._p_r*phi(n)/6.
a(n) = n^2*A000010(n)/3 + n*A023900(n)/6, n>1. [Brown]
a(n) = (A000010(n)/3) * (n^2 + (-1)^A001221(n)*A007947(n)/2) for n>=2. - Jaroslav Krizek, Aug 24 2010
G.f. A(x) satisfies: A(x) = x*(1 + x)/(1 - x)^4 - Sum_{k>=2} k^2 * A(x^k). - Ilya Gutkovskiy, Mar 29 2020
Sum_{k=1..n} a(k) ~ n^4 / (2*Pi^2). - Amiram Eldar, Dec 03 2023

A053820 a(n) = Sum_{k=1..n, gcd(n,k) = 1} k^4.

Original entry on oeis.org

1, 1, 17, 82, 354, 626, 2275, 3108, 7395, 9044, 25333, 17668, 60710, 50470, 88388, 103496, 243848, 129750, 432345, 266088, 497574, 497178, 1151403, 539912, 1541770, 1153724, 1900089, 1516844, 3756718, 1246568, 5273999
Offset: 1

Views

Author

N. J. A. Sloane, Apr 07 2000

Keywords

Comments

If gcd(n,30) = 1, then a(n) is divisible by n. If n has at least one prime factor == 1 (mod 30), then a(n) is divisible by n. - Jianing Song, Jul 13 2018

References

  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 48, problem 15, the function phi_4(n).
  • L. E. Dickson, History of the Theory of Numbers, Vol. I (Reprint 1966), p. 140.

Crossrefs

Column k=4 of A308477.

Programs

  • Mathematica
    a[n_] := Sum[If[GCD[n, k] == 1, k^4, 0], {k, 1, n}]; Table[a[n], {n, 1, 31}] (* Jean-François Alcover, Feb 26 2014 *)
    a[1] = 1; a[n_] := Module[{f = FactorInteger[n], p, e}, p = f[[;; , 1]]; e = f[[;; , 2]]; (n^4/5) * Times @@ ((p - 1)*p^(e - 1)) + (n^3/3) * Times @@ (1 - p) - (n/30) * Times @@ (1 - p^3)]; Array[a, 100] (* Amiram Eldar, Dec 03 2023 *)
  • PARI
    a(n) = sum(k=1, n, (gcd(n,k) == 1)*k^4); \\ Michel Marcus, Feb 26 2014
    
  • PARI
    a(n) = {my(f = factor(n)); if(n == 1, 1, (n^4/5) * eulerphi(f) + (n^3/3) * prod(i = 1, #f~, 1 - f[i, 1]) - (n/30) * prod(i = 1, #f~, 1 - f[i, 1]^3));} \\ Amiram Eldar, Dec 03 2023

Formula

a(n) = (6*n^4*A000010(n)+10*n^3*A023900(n)-n*A063453(n))/30 for n>1. Formula is derived from a more general formula of A. Thacker (1850), see [Dickson, Brown]. - Franz Vrabec, Aug 21 2005
G.f. A(x) satisfies: A(x) = x*(1 + 11*x + 11*x^2 + x^3)/(1 - x)^6 - Sum_{k>=2} k^4 * A(x^k). - Ilya Gutkovskiy, Mar 29 2020
Sum_{k=1..n} a(k) ~ n^6 / (5*Pi^2). - Amiram Eldar, Dec 03 2023

A308477 Square array A(n,k), n >= 1, k >= 0, read by antidiagonals: A(n,k) = Sum_{j=1..n, gcd(n,j) = 1} j^k.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1, 5, 4, 4, 1, 1, 9, 10, 10, 2, 1, 1, 17, 28, 30, 6, 6, 1, 1, 33, 82, 100, 26, 21, 4, 1, 1, 65, 244, 354, 126, 91, 16, 6, 1, 1, 129, 730, 1300, 626, 441, 84, 27, 4, 1, 1, 257, 2188, 4890, 3126, 2275, 496, 159, 20, 10, 1, 1, 513, 6562, 18700, 15626, 12201, 3108, 1053, 140, 55, 4
Offset: 1

Views

Author

Ilya Gutkovskiy, May 29 2019

Keywords

Examples

			Square array begins:
  1,   1,   1,    1,    1,     1,  ...
  1,   1,   1,    1,    1,     1,  ...
  2,   3,   5,    9,   17,    33,  ...
  2,   4,  10,   28,   82,   244,  ...
  4,  10,  30,  100,  354,  1300,  ...
  2,   6,  26,  126,  626,  3126,  ...
		

Crossrefs

Columns k=0..4 give A000010, A023896, A053818, A053819, A053820.
Cf. A103438.

Programs

  • Mathematica
    Table[Function[k, Sum[If[GCD[n, j] == 1, j^k, 0], {j, 1, n}]][i - n], {i, 0, 12}, {n, 1, i}] // Flatten

A295574 a(n) = Sum_{1 <= j <= n/2, gcd(j,n)=1} j^2.

Original entry on oeis.org

0, 1, 1, 1, 5, 1, 14, 10, 21, 10, 55, 26, 91, 35, 70, 84, 204, 75, 285, 140, 210, 165, 506, 196, 525, 286, 549, 406, 1015, 340, 1240, 680, 880, 680, 1190, 654, 2109, 969, 1482, 1080, 2870, 966, 3311, 1650, 2010, 1771, 4324, 1544, 4214, 2050
Offset: 1

Views

Author

N. J. A. Sloane, Dec 08 2017

Keywords

Comments

n does not divide a(n) iff n = (2^k)*(q^m) with k > 0, m >= 0 and q odd prime such that q == 3 (mod 4) or n = (2^k)*(3^L)*Product_{q} q^(v_q) with k >= 0, L > 0, v_q >= 0 and all q odd primes such that q == 5 (mod 6). - René Gy, Oct 21 2018

Crossrefs

In the Baum (1982) paper, S_1, S_2, S_3, S_4 are A023896, A053818, A053819, A053820, and S'_1, S'_2, S'_3, S'_4 are A066840, A295574, A295575, A295576.
Cf. A023022.

Programs

  • Maple
    R:=proc(n,k) local x,t1,S;
    t1:={}; S:=0;
    for x from 1 to floor(n/2) do if gcd(x,n)=1 then t1:={op(t1),x^k}; S:=S+x^k; fi; od;
    S; end;
    s:=k->[seq(R(n,k),n=1..50)];
    s(2);
  • Mathematica
    f[n_] := Plus @@ (Select[ Range[n/2], GCD[#, n] == 1 &]^2); Array[f, 50] (* Robert G. Wilson v, Dec 10 2017 *)
  • PARI
    a(n) = sum(j=1, n\2, (gcd(j, n)==1)*j^2); \\ Michel Marcus, Dec 10 2017

A295575 a(n) = Sum_{1 <= j <= n/2, gcd(j,n)=1} j^3.

Original entry on oeis.org

0, 1, 1, 1, 9, 1, 36, 28, 73, 28, 225, 126, 441, 153, 416, 496, 1296, 469, 2025, 1100, 1710, 1225, 4356, 1800, 4959, 2556, 5581, 4410, 11025, 3872, 14400, 8128, 11090, 8128, 15822, 8910, 29241, 13041, 21996, 16400, 44100, 15426, 53361, 27830, 33716, 29161, 76176, 27936, 77652, 37828
Offset: 1

Views

Author

N. J. A. Sloane, Dec 08 2017

Keywords

Comments

If p is an odd prime, a(p) = (n^2-1)^2/64. - Robert Israel, Dec 10 2017

Crossrefs

In the Baum (1982) paper, S_1, S_2, S_3, S_4 are A023896, A053818, A053819, A053820, and S'_1, S'_2, S'_3, S'_4 are A066840, A295574, A295575, A295576.

Programs

  • Maple
    f:= n -> add(t^3, t = select(t->igcd(t,n)=1, [$1..n/2])) :
    map(f, [$1..100]); # Robert Israel, Dec 10 2017
  • Mathematica
    f[n_] := Plus @@ (Select[Range[n/2], GCD[#, n] == 1 &]^3); Array[f, 50] (* Robert G. Wilson v, Dec 10 2017 *)
  • PARI
    a(n) = sum(j=1, n\2, (gcd(j, n)==1)*j^3); \\ Michel Marcus, Dec 10 2017

A295576 a(n) = Sum_{1 <= j <= n/2, gcd(j,n)=1} j^4.

Original entry on oeis.org

0, 1, 1, 1, 17, 1, 98, 82, 273, 82, 979, 626, 2275, 707, 2674, 3108, 8772, 3027, 15333, 9044, 14994, 9669, 39974, 17668, 50085, 24310, 60597, 50470, 127687, 45604, 178312, 103496, 149908, 103496, 225302, 129750, 432345, 187017, 349830, 266088, 722666
Offset: 1

Views

Author

N. J. A. Sloane, Dec 08 2017

Keywords

Comments

If p is an odd prime, a(p) = p*(p^2-1)*(3*p^2-7)/480. - Robert Israel, Dec 10 2017

Crossrefs

In the Baum (1982) paper, S_1, S_2, S_3, S_4 are A023896, A053818, A053819, A053820, and S'_1, S'_2, S'_3, S'_4 are A066840, A295574, A295575, A295576.

Programs

  • Maple
    f:= n -> add(t^4, t = select(t->igcd(t,n)=1, [$1..n/2])):
    map(f, [$1..100]); # Robert Israel, Dec 10 2017
  • Mathematica
    f[n_] := Plus @@ (Select[Range[n/2], GCD[#, n] == 1 &]^4); Array[f, 41] (* Robert G. Wilson v, Dec 10 2017 *)
  • PARI
    a(n) = sum(j=1, n\2, (gcd(j, n)==1)*j^4); \\ Michel Marcus, Dec 10 2017

A343513 a(n) = Sum_{k=1..n} (k/gcd(n, k))^3.

Original entry on oeis.org

1, 2, 10, 30, 101, 137, 442, 526, 1063, 1202, 3026, 1965, 6085, 4853, 7310, 8654, 18497, 10100, 29242, 17630, 29557, 30857, 64010, 30397, 77601, 60842, 89272, 71913, 164837, 60737, 216226, 139470, 188165, 180338, 265142, 152544, 443557, 282665, 371134, 275726, 672401, 251066, 815410, 461645
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 17 2021

Keywords

Comments

a(n) = 1+n^2*(n-1)^2/4 if n is prime. - Robert Israel, Apr 19 2021

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
      add((k/igcd(n,k))^3,k=1..n)
    end proc:
    map(f, [$1..100]); # Robert Israel, Apr 19 2021
  • Mathematica
    Table[Sum[(k/GCD[n, k])^3, {k, 1, n}], {n, 1, 44}]
  • PARI
    a(n) = sum(k=1, n, (k/gcd(n, k))^3); \\ Michel Marcus, Apr 17 2021

Formula

a(n) = Sum_{d|n} A053819(d).

A057789 a(n) = Sum_{k = 1..n, gcd(k,n)=1} k*(n-k).

Original entry on oeis.org

0, 1, 4, 6, 20, 10, 56, 44, 84, 60, 220, 92, 364, 182, 280, 344, 816, 318, 1140, 520, 840, 770, 2024, 760, 2100, 1300, 2196, 1540, 4060, 1240, 4960, 2736, 3520, 2992, 4760, 2580, 8436, 4218, 5928, 4240, 11480, 3612, 13244, 6380, 8040, 7590, 17296, 6128
Offset: 1

Views

Author

Leroy Quet, Nov 04 2000

Keywords

Comments

Equal to convolution sum over positive integers, k, where k<=n and gcd(k,n)=1, except in first term, where the convolution sum is 1 instead of 0.

Examples

			Since 1, 3, 5 and 7 are relatively prime to 8 and are <= 8, a(8) = 1*(8-1) +3*(8-3) +5*(8-5) +7*(8-7) = 44.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local i;
      2*add(`if`(igcd(i,n)=1, i*(n-i),0),i=1..n/2)
    end proc:
    f(2):= 1:
    map(f, [$1..100]); # Robert Israel, Sep 29 2019
  • Mathematica
    a[n_] := 2 Sum[Boole[CoprimeQ[k, n]] k (n - k), {k, 1, n/2}];
    a[2] = 1;
    Array[a, 100] (* Jean-François Alcover, Aug 16 2020, after Maple *)
  • PARI
    a(n) = sum(k=1, n, if (gcd(n,k)==1, k*(n-k))); \\ Michel Marcus, Sep 29 2019

Formula

From Robert Israel, Sep 29 2019: (Start)
If n is prime, a(n) = A000292(n-1).
If n/2 is an odd prime, a(n) = A000292(n-2)/2.
If n/3 is a prime other than 3, a(n) = A000292(n-3)*2*n/(3*(n-2)). (End)
From Ridouane Oudra, Mar 21 2024: (Start)
a(n) = n*A023896(n) - A053818(n) ;
a(n) = (2/3)*(n*A023896(n) - A053819(n)/n) ;
a(n) = (n/6)*(A002618(n) - A023900(n)) ;
a(n) = (1/6)*(A053191(n) - n*A023900(n)). (End)
Sum_{k=1..n} a(k) ~ n^4 / (4*Pi^2). - Amiram Eldar, Apr 11 2024

A057792 Sum[k^k], where sum is over positive integers, k, where k <= n and gcd(k,n) = 1.

Original entry on oeis.org

1, 1, 5, 28, 288, 3126, 50069, 826696, 17604145, 388244060, 10405071317, 285312497280, 9211817190184, 303160805686506, 11415167261421900, 438197051187369424, 18896062057839751444, 827240565046755853710
Offset: 1

Views

Author

Leroy Quet, Nov 04 2000

Keywords

Examples

			a(4) = 1^1 + 3^3 = 28, since 1 and 3 are the positive integers <= 4 and relatively prime to 4.
		

Crossrefs

Programs

  • PARI
    a(n) = sum(k=1, n, if (gcd(k, n)==1, k^k)); \\ Michel Marcus, Jun 19 2021
Showing 1-9 of 9 results.