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

A018804 Pillai's arithmetical function: Sum_{k=1..n} gcd(k, n).

Original entry on oeis.org

1, 3, 5, 8, 9, 15, 13, 20, 21, 27, 21, 40, 25, 39, 45, 48, 33, 63, 37, 72, 65, 63, 45, 100, 65, 75, 81, 104, 57, 135, 61, 112, 105, 99, 117, 168, 73, 111, 125, 180, 81, 195, 85, 168, 189, 135, 93, 240, 133, 195, 165, 200, 105, 243, 189, 260, 185, 171, 117, 360
Offset: 1

Views

Author

Keywords

Comments

a(n) is the number of times the number 1 appears in the character table of the cyclic group C_n. - Ahmed Fares (ahmedfares(AT)my-deja.com), Jun 02 2001
a(n) is the number of ways to express all fractions f/g whereby each product (f/g)*n is a natural number between 1 and n (using fractions of the form f/g with 1 <= f,g <= n). For example, for n=4 there are 8 such fractions: 1/1, 1/2, 2/2, 3/3, 1/4, 2/4, 3/4 and 4/4. - Ron Lalonde (ronronronlalonde(AT)hotmail.com), Oct 03 2002
Number of non-congruent solutions to xy == 0 (mod n). - Yuval Dekel (dekelyuval(AT)hotmail.com), Oct 06 2003
Conjecture: n>1 divides a(n)+1 iff n is prime. - Thomas Ordowski, Oct 22 2014
The above conjecture is false, with counterexample given by n = 3*37*43*42307*116341 and a(n)+1 = 26*n. - Varun Vejalla, Jun 19 2025
a(n) is the number of 0's in the multiplication table Z/nZ (cf. A000010 for number of 1's). - Eric Desbiaux, Jun 11 2015
{a(n)} == 1, 3, 1, 0, 1, 3, 1, 0, ... (mod 4). - Isaac Saffold, Dec 30 2017
Since a(p^e) = p^(e-1)*((p-1)e+p) it follows a(p) = 2p-1 and therefore p divides a(p)+1. - Ruediger Jehn, Jun 23 2022

Examples

			G.f. = x + 3*x^2 + 5*x^3 + 8*x^4 + 9*x^5 + 15*x^6 + 13*x^7 + 20*x^8 + ...
		

References

  • S. S. Pillai, On an arithmetic function, J. Annamalai University 2 (1933), pp. 243-248.
  • J. Sándor, A generalized Pillai function, Octogon Mathematical Magazine Vol. 9, No. 2 (2001), 746-748.

Crossrefs

Column 1 of A343510 and A343516.
Cf. A080997, A080998 for rankings of the positive integers in terms of centrality, defined to be the average fraction of an integer that it shares with the other integers as a gcd, or A018804(n)/n^2, also A080999, a permutation of this sequence (A080999(n) = A018804(A080997(n))).

Programs

  • Haskell
    a018804 n = sum $ map (gcd n) [1..n]  -- Reinhard Zumkeller, Jul 16 2012
    
  • Magma
    [&+[Gcd(n,k):k in [1..n]]:n in [1..60]]; // Marius A. Burtea, Nov 14 2019
  • Maple
    a:=n->sum(igcd(n,j),j=1..n): seq(a(n), n=1..60); # Zerinvary Lajos, Nov 05 2006
  • Mathematica
    f[n_] := Block[{d = Divisors[n]}, Sum[ d*EulerPhi[n/d], {d, d}]]; Table[f[n], {n, 60}] (* Robert G. Wilson v, Mar 20 2012 *)
    a[ n_] := If[ n < 1, 0, n Sum[ EulerPhi[d] / d, {d, Divisors@n}]]; (* Michael Somos, Jan 07 2017 *)
    f[p_, e_] := (e*(p - 1)/p + 1)*p^e; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Jul 19 2019 *)
  • PARI
    {a(n) = direuler(p=2, n, (1 - X) / (1 - p*X)^2)[n]}; /* Michael Somos, May 31 2000 */
    
  • PARI
    a(n)={ my(ct=0); for(i=0,n-1,for(j=0,n-1, ct+=(Mod(i*j,n)==0) ) ); ct; } \\ Joerg Arndt, Aug 03 2013
    
  • PARI
    a(n)=my(f=factor(n)); prod(i=1,#f~,(f[i,2]*(f[i,1]-1)/f[i,1] + 1)*f[i,1]^f[i,2]) \\ Charles R Greathouse IV, Oct 28 2014
    
  • PARI
    a(n) = sumdiv(n, d, n*eulerphi(d)/d); \\ Michel Marcus, Jan 07 2017
    
  • Python
    from sympy.ntheory import totient, divisors
    print([sum(n*totient(d)//d for d in divisors(n)) for n in range(1, 101)]) # Indranil Ghosh, Apr 04 2017
    
  • Python
    from sympy import factorint
    from math import prod
    def A018804(n): return prod(p**(e-1)*((p-1)*e+p) for p, e in factorint(n).items()) # Chai Wah Wu, Nov 29 2021
    

Formula

a(n) = Sum_{d|n} d*phi(n/d), where phi(n) is Euler totient function (cf. A000010). - Vladeta Jovovic, Apr 04 2001
Multiplicative; for prime p, a(p^e) = p^(e-1)*((p-1)e+p).
Dirichlet g.f.: zeta(s-1)^2/zeta(s).
a(n) = Sum_{d|n} d*tau(d)*mu(n/d). - Benoit Cloitre, Oct 23 2003
Equals A054523 * [1,2,3,...]. Equals row sums of triangle A010766. - Gary W. Adamson, May 20 2007
Equals inverse Mobius transform of A029935 = A054525 * (1, 2, 4, 5, 8, 8, 12, 12, ...). - Gary W. Adamson, Aug 02 2008, corrected Feb 07 2023
Equals row sums of triangle A127478. - Gary W. Adamson, Aug 03 2008
G.f.: Sum_{k>=1} phi(k)*x^k/(1 - x^k)^2, where phi(k) is the Euler totient function. - Ilya Gutkovskiy, Jan 02 2017
a(n) = Sum_{a = 1..n} Sum_{b = 1..n} Sum_{c = 1..n} 1, for n > 1. The sum is over a,b,c such that n*c - a*b = 0. - Benedict W. J. Irwin, Apr 04 2017
Proof: Let gcd(a, n) = g and x = n/g. Define B = {x, 2*x, ..., g*x}; then for all b in B there exists a number c such that a*b = n*c. Since the set B has g elements it follows that Sum_{b=1..n} Sum_{c=1..n} 1 >= g = gcd(a, n) and therefore Sum_{a=1..n} Sum_{b=1..n} Sum_{c=1..n} 1 >= Sum_{a=1..n} gcd(a, n). On the other hand, for all b not in B there is no number c <= n such that a*b = n*c and hence Sum_{b = 1..n} Sum_{c = 1..n} 1 = g. Therefore Sum_{a=1..n} Sum_{b = 1..n} Sum_{c = 1..n} 1 = a(n). - Ruediger Jehn, Jun 23 2022
a(2*n) = a(n)*(3-A007814(n)/(A007814(n)+2)) - Velin Yanev, Jun 30 2017
Proof: Let m = A007814(m) and decompose n into n = k*2^m. We know from Chai Wah Wu's program below that a(n) = Product(p_i^(e_i-1)*((p_i-1)*e_i+p_i)) where the numbers p_i are the prime factors of n and e_i are the corresponding exponents. Hence a(2n) = 2^m*(m+3)*a(k) = 2^m*(m+3)*a(k). On the other hand, a(n) = 2^(m-1)*(m+2)*a(k). Dividing the first equation by the second yields a(2n)/a(n) = 2*(m+3)/(m+2), which equals 3 - m/(m+2). Hence a(2n) = a(n)*(3 - m/(m+2)). - Ruediger Jehn, Jun 23 2022
Sum_{k=1..n} a(k) ~ 3*n^2/Pi^2 * (log(n) - 1/2 + 2*gamma - 6*Zeta'(2)/Pi^2), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Feb 08 2019
a(n) = Sum_{k=1..n} n/gcd(n,k)*phi(gcd(n,k))/phi(n/gcd(n,k)). - Richard L. Ollerton, May 10 2021
log(a(n)/n) << log n log log log n/log log n; in particular, a(n) << n^(1+e) for any e > 0. See Broughan link for bounds in terms of omega(n). - Charles R Greathouse IV, Sep 08 2022
a(n) = (1/4)*Sum_{k = 1..4*n} (-1)^k * gcd(k, 4*n) = (1/4) * A344372(2*n). - Peter Bala, Jan 01 2024

A228383 Area A of the triangle such that A, the sides, and the inradius are integers.

Original entry on oeis.org

6, 24, 30, 36, 42, 48, 54, 60, 66, 84, 96, 108, 114, 120, 126, 132, 144, 150, 156, 168, 180, 192, 198, 210, 216, 240, 252, 264, 270, 294, 300, 324, 330, 336, 360, 378, 384, 390, 396, 408, 420, 432, 456, 462, 468, 480, 486, 504, 510, 522, 528, 540, 546, 570
Offset: 1

Views

Author

Michel Lagneau, Aug 21 2013

Keywords

Comments

The sequences A208984 and A185210 are subsequences of this sequence. The corresponding inradius r are 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 3, ...
The area A of a triangle whose sides have lengths a, b, and c is given by Heron's formula: A = sqrt(s*(s-a)*(s-b)*(s-c)), where s = (a+b+c)/2. The inradius r is given by r = A/s.
a(n) is divisible by 6 and the squares of the form 36k^2 are in the sequence.

Examples

			24 is in the sequence because for (a, b, c) = (6, 8, 10) => s =(6 + 8 + 10)/2 = 12; A = sqrt(12*(12-6)*(12-8)*(12-10)) = sqrt(576)= 24; r = A/s = 2.
		

Crossrefs

Programs

  • Mathematica
    nn = 1000; lst = {}; Do[s = (a + b + c)/2; If[IntegerQ[s], area2 = s (s - a) (s - b) (s - c); If[0 < area2 <= nn^2 && IntegerQ[Sqrt[area2]] && IntegerQ[Sqrt[area2]/s], AppendTo[lst, Sqrt[area2]]]], {a, nn}, {b, a}, {c, b}]; Union[lst]

A350378 Integer areas of integer-sided triangles such that the distance d between the incenter and the circumcenter is a prime number.

Original entry on oeis.org

48, 768, 3840, 108000, 1134000, 200202240, 4382077920
Offset: 1

Views

Author

Michel Lagneau, Dec 28 2021

Keywords

Comments

Subsequence of A231174. The sequence is probably infinite.
The corresponding sequence of the primes d is {5, 5, 13, 17, 53, 193, 241,...} (see A350379).
In geometry, Euler's theorem states that the distance between the incenter and circumcenter can be expressed as d = sqrt(R(R-2r)), where R is the circumradius and r is the inradius.
The area A of a triangle whose sides have lengths a, b, and c is given by Heron's formula: A = sqrt(s(s-a)(s-b)(s-c)), where s = (a+b+c)/2.
The inradius r is given by r = A/s and the circumradius is given by R = abc/4A.
The following table gives the first values (A, a, b, c, r, R, d) where A is the area of the triangles, a, b, c are the integer sides of the triangles, r is the inradius, R is the circumradius and d is the distance between the incenter and circumcenter with d = sqrt(R(R-2r)).
+------------+--------+--------+---------+---------+---------+-----+
| A | a | b | c | r | R | d |
+------------+--------+--------+---------+---------+---------+-----+
| 48 | 10 | 10 | 16 | 8/3 | 25/3 | 5 |
| 768 | 40 | 40 | 48 | 12 | 25 | 5 |
| 3840 | 80 | 104 | 104 | 80/3 | 169/3 | 13 |
| 108000 | 480 | 510 | 510 | 144 | 289 | 17 |
| 1134000 | 1590 | 1590 | 1680 | 1400/3 | 2809/3 | 53 |
| 200202240 | 21280 | 21616 | 21616 | 18620/3 | 37249/3 | 193 |
| 4382077920 | 100320 | 100738 | 100738 | 29040 | 58081 | 241 |
....................................................................
From the previous table, we observe that the triangles are isosceles, the distance between the incenter and the circumcenter is d = sqrt(R) if R is a perfect square, or d = sqrt(3R) if R is of the form k^2/3, k integer. We also observe that d divides the two equal sides of the isosceles triangles: 10/5 = 2, 40/5 = 8, 104/13 = 8, 510/17 = 30, 1590/853 = 30, 21616/193 = 112, 100738/241 = 418, ....

References

  • Mohammad K. Azarian, Circumradius and Inradius, Problem S125, Math Horizons, Vol. 15, Issue 4, April 2008, p. 32.
  • R. A. Johnson, Modern Geometry: An Elementary Treatise on the Geometry of the Triangle and the Circle. Boston, MA: Houghton Mifflin, 1929.

Crossrefs

Programs

  • Mathematica
    nn=520; lst={};Do[s=(a+b+c)/2;If[IntegerQ[s],area2=s (s-a)(s-b)(s-c); If[area2>0&&IntegerQ[Sqrt[area2]]&&PrimeQ[Sqrt[a*b*c/(4*Sqrt[area2])*(a*b*c/(4*Sqrt[area2])-2*Sqrt[area2]/s)]],Print[Sqrt[area2]," ",c," ",b," ",a," ",Sqrt[area2]/s," ",a*b*c/(4*Sqrt[area2])," ",Sqrt[a*b*c/(4*Sqrt[area2])*(a*b*c/(4*Sqrt[area2])-2*Sqrt[area2]/s)]]]],{a,nn},{b,a},{c,b}]

A350379 Consider integer-sided triangles having integer area and let d be the distance between the center of the inscribed circle and the center of the circumscribed circle. The sequence lists the set of distances d which are prime numbers.

Original entry on oeis.org

5, 13, 17, 53, 193, 241
Offset: 1

Views

Author

Michel Lagneau, Dec 28 2021

Keywords

Comments

The corresponding integer areas of integer-sided triangles such that the distance between the incenter and the circumcenter is a prime number is given by the sequence A350378.
In geometry, Euler's theorem states that the distance between the incenter and circumcenter can be expressed as d = sqrt(R(R-2r)), where R is the circumradius and r is the inradius.
The area A of a triangle whose sides have lengths a, b, and c is given by Heron's formula: A = sqrt(s(s-a)(s-b)(s-c)), where s = (a+b+c)/2.
The inradius r is given by r = A/s and the circumradius is given by R = abc/4A.
The following table gives the first values (A, a, b, c, r, R, d) where A is the area of the triangles, a, b, c are the integer sides of the triangles, r is the inradius, R is the circumradius and d is the distance between the incenter and circumcenter with d = sqrt(R(R-2r)).
+------------+--------+--------+---------+---------+---------+-----+
| A | a | b | c | r | R | d |
+------------+--------+--------+---------+---------+---------+-----+
| 48 | 10 | 10 | 16 | 8/3 | 25/3 | 5 |
| 768 | 40 | 40 | 48 | 12 | 25 | 5 |
| 3840 | 80 | 104 | 104 | 80/3 | 169/3 | 13 |
| 108000 | 480 | 510 | 510 | 144 | 289 | 17 |
| 1134000 | 1590 | 1590 | 1680 | 1400/3 | 2809/3 | 53 |
| 200202240 | 21280 | 21616 | 21616 | 18620/3 | 37249/3 | 193 |
| 4382077920 | 100320 | 100738 | 100738 | 29040 | 58081 | 241 |
....................................................................
From the previous table, we observe that the triangles are isosceles, the distance between the incenter and the circumcenter is d = sqrt(R) if R is a perfect square, or d = sqrt(3R) if R is of the form k^2/3, k integer. We also observe that d divides the two equal sides of the isosceles triangle: 10/5 = 2, 40/5 = 8, 104/13 = 8, 510/17 = 30, 1590/853 = 30, 21616/193 = 112, 100738/241 = 418, ....

References

  • Mohammad K. Azarian, Circumradius and Inradius, Problem S125, Math Horizons, Vol. 15, Issue 4, April 2008, p. 32.
  • R. A. Johnson, Modern Geometry: An Elementary Treatise on the Geometry of the Triangle and the Circle. Boston, MA: Houghton Mifflin, 1929.

Crossrefs

Programs

  • Mathematica
    nn=520;lst={};Do[s=(a+b+c)/2;If[IntegerQ[s],area2=s (s-a)(s-b)(s-c);If[area2>0&&IntegerQ[Sqrt[area2]]&&PrimeQ[Sqrt[a*b*c/(4*Sqrt[area2])*(a*b*c/(4*Sqrt[area2])-2*Sqrt[area2]/s)]],Print[Sqrt[area2]," ",c," ",b," ",a," ",Sqrt[area2]/s," ",a*b*c/(4*Sqrt[area2])," ",Sqrt[a*b*c/(4*Sqrt[area2])*(a*b*c/(4*Sqrt[area2])-2*Sqrt[area2]/s)]]]],{a,nn},{b,a},{c,b}]

A233317 Integer areas A of the integer-sided triangles such that the inradius and the radius of the three excircles are perfect squares.

Original entry on oeis.org

108, 1728, 8748, 12348, 27648, 67500, 139968, 197568, 259308, 442368, 707472, 708588, 1000188, 1080000, 1581228, 2239488, 3084588, 3161088, 4148928, 5467500, 7077888, 7717500, 9020268, 11319552, 11337408, 14074668, 16003008, 17280000, 21003948, 25299648
Offset: 1

Views

Author

Michel Lagneau, Dec 07 2013

Keywords

Comments

Subset of A185210.
A = sqrt(s*(p-a)*(s-b)*(s-c)) with s = (a+b+c)/2 (Heron's formula);
The inradius is r = A/s;
The radii of the three excircles are r1 = 2*A/(-a+b+c); x2 = 2*A*b/(a-b+c); x3 = 2*A*c/(a+b-c).
The areas A of the primitive triangles of sides (a,b,c) are 108, 12348, ...
The areas of the nonprimitive triangles of sides (a*p^2, b*p^2, c*p^2) are in the sequence with the value A*p^4.
The following table gives the first values (A, a, b, c, r, r1, r2, r3) where A is the area of the triangle, a, b, c the integer sides, r, r1, r2 and r3 are respectively the length of the inradius and the radius of the three excircles.
+--------+-----+------+------+------+------+------+------+
| A | a | b | c | r | r1 | r2 | r3 |
+--------+-----+------+------+------+------+------+------+
| 108 | 15 | 15 | 24 | 2^2 | 3^2 | 3^2 | 6^2 |
| 1728 | 60 | 60 | 96 | 4^2 | 6^2 | 6^2 | 12^2 |
| 8748 | 135 | 135 | 216 | 6^2 | 9^2 | 9^2 | 18^2 |
| 12348 | 91 | 280 | 315 | 6^2 | 7^2 | 14^2 | 21^2 |
| 27648 | 240 | 240 | 384 | 8^2 | 12^2 | 12^2 | 24^2 |
| 67500 | 375 | 375 | 600 | 10^2 | 15^2 | 15^2 | 30^2 |
| 139968 | 540 | 540 | 864 | 12^2 | 18^2 | 18^2 | 36^2 |
| 197568 | 364 | 1120 | 1260 | 12^2 | 14^2 | 28^2 | 42^2 |
| 259308 | 735 | 735 | 1176 | 14^2 | 21^2 | 21^2 | 42^2 |
+--------+-----+------+------+------+------+------+------+

Crossrefs

Cf. A185210.

Programs

  • Mathematica
    nn = 1000; lst = {}; Do[s = (a + b + c)/2; If[IntegerQ[s], area2 = s (s - a) (s - b) (s - c); If[area2>0&& IntegerQ[Sqrt[area2]] && IntegerQ[Sqrt[Sqrt[area2]/s]] && IntegerQ[Sqrt[2*Sqrt[area2]/(-a+b+c)]] && IntegerQ[Sqrt[2*Sqrt[area2]/(a-b+c)]] && IntegerQ[Sqrt[2*Sqrt[area2]/(a+b-c)]], AppendTo[lst, Sqrt[area2]]]], {a, nn}, {b, a}, {c, b}]; Union[lst]
Showing 1-5 of 5 results.