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 11-20 of 21 results. Next

A127415 a(n) = Sum_{1<=k<=n, gcd(k,n)=1}, A000217(k).

Original entry on oeis.org

1, 1, 4, 7, 20, 16, 56, 50, 93, 80, 220, 110, 364, 224, 340, 372, 816, 354, 1140, 580, 966, 880, 2024, 820, 2200, 1456, 2304, 1666, 4060, 1240, 4960, 2856, 3850, 3264, 5180, 2706, 8436, 4560, 6396, 4440, 11480, 3612, 13244, 6710, 8400, 8096, 17296, 6344, 17297, 8600
Offset: 1

Views

Author

Gary W. Adamson, Jan 13 2007

Keywords

Comments

From Wolfdieter Lang, Jun 14 2011: (Start)
Such sums are over a reduced residue system modulo n. See the Apostol reference, p. 133, for the definition or the wikipedia link given under A189918.
This sum over triangular numbers can be found using the results given in exercise 16 of the Apostol reference on p. 48, together with the definition of phi_1(n) and phi_2(n) from the exercise 15.
The result for n >= 2 coincides with the formula given below, using Product_{p|n} (1 - p) = mu(rad(n))*rad(n)*phi(n)/n, with the definitions given there.
(End)

Examples

			a(6) = 16 since the relative primes of 6 are 1 and 5 and (1 + 15) = 16.
a(6) = (6/(3!*2))*(15*6 + 1*6)*(1/2)*(2/3)= 16.
		

References

  • T. Apostol, Introduction to Analytic Number Theory, Springer, 1986.

Crossrefs

Programs

  • Mathematica
    rad[n_] := Times @@ (FactorInteger[n][[ All, 1]]); a[n_] := (n/(3!*2))*((2*n+3)*n + MoebiusMu[ rad[n]]*rad[n])*(EulerPhi[n] / n); a[1] = 1; Table[ a[n], {n, 1, 33}] (* Jean-François Alcover, Oct 03 2011 *)
  • PARI
    a(n)=if(n<3,return(1));my(s=factor(n)[,1]); s=prod(i=1,#s,s[i]); (n/12)*((2*n+3)*n + moebius(s)*s)*(eulerphi(n)/n) \\ Charles R Greathouse IV, May 17 2011
    
  • PARI
    a(n) = sum(k=1, n, if (gcd(n,k)==1, k*(k+1)/2)); \\ Michel Marcus, Feb 01 2016

Formula

M * V where M = A054521 is an infinite lower triangular matrix and V = A000217: (1, 3, 6, 10, ...).
From Wolfdieter Lang, May 17 2011: (Start)
a(n) = (n/(3!*2))*((2*n+3)*n + mu(rad(n))*rad(n))*(phi(n)/n), n >= 2, with rad(n) the squarefree kernel of n (the largest squarefree number dividing n, see A007947), the Moebius function mu(n)=A008683(n), and the Euler totient function phi(n)= A000010(n).
Note that phi(n)/n = A076512(n)/A109395(n) = phi(rad(n))/rad(n).
Proof via inclusion-exclusion.
(End)

Extensions

More terms and formula from Wolfdieter Lang, May 17 2011
More terms from Michel Marcus, Feb 01 2016

A189918 Sum of tetrahedral numbers A000292(k), with k in the reduced residue system modulo n.

Original entry on oeis.org

0, 1, 5, 11, 35, 36, 126, 130, 264, 260, 715, 406, 1365, 952, 1530, 1716, 3876, 1830, 5985, 3300, 5796, 5500, 12650, 5460, 15075, 10556, 16965, 12810, 31465, 9920, 40920, 24616, 34650, 30192, 49210, 26106, 82251, 46740, 67158, 47320
Offset: 1

Views

Author

Wolfdieter Lang, May 19 2011

Keywords

Comments

The reduced residue system modulo n used here is the set of numbers k from the set {0,1,...,n-1} which satisfy gcd(k,n)=1. There are phi(n) = A000010(n) such numbers k. Cf. A038566. See also the Apostol reference p. 133, and the Wikipedia link.
This is the m=3 member of a family of sequences, call them rmnS(m) (reduced mod n sum), with entries rmnS(m;n):=sum(binomial(k+m-1,m),0<=k<=n-1 with gcd(k,n)=1), m>=0, n>=1. Recall gcd(0,n)=n.
The members for m=0, 1, and 2 are A000010(n), A023896(n) and A127415(n), respectively, where in the last two the offset for n=1 should be taken as 0 (not 1).

Examples

			a(6) = A000292(1) + A000292(5)= 1 + 35 = 36.
a(6) = (6*8/4!)*(6*8 + 1*6)*((1/2)*(2/3)) = 36.
a(12) = A000292(1) + A000292(5) + A000292(7) + A000292(11) = 1 + 35 + 84 + +286 = 406.
a(12) = (12*14/4!)*(12*14 + 1*6)*((1/2)*(2/3)) = 406.
		

References

  • T. Apostol, Introduction to Analytic Number Theory, Springer, 1986.

Crossrefs

Programs

  • Maple
    A000292 := proc(n) binomial(n+2,3) ; end proc:
    A189918 := proc(n) local a; a := 0 ; for k from 0 to n-1 do if igcd(k,n) = 1 then a := a+A000292(k); end if; end do: a ; end proc:
    seq(A189918(n),n=1..40) ; # R. J. Mathar, Jun 13 2011
  • Mathematica
    a[n_] := Sum[ Boole[GCD[k, n] == 1]*k*(k+1)*(k+2)/6, {k, 0, n-1}]; Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Jul 12 2012 *)
  • PARI
    a(n) = sum(k=0, n-1, if (gcd(n,k)==1, k*(k+1)*(k+2)/6)); \\ Michel Marcus, Feb 01 2016

Formula

a(n) = Sum_{k=0..n-1, gcd(k,n)=1 } * A000292(k), n>=1.
a(n) = (n*(n+2)/4!) *{n*(n+2) + mu(rad(n))*rad(n)} *phi(n)/n, n>=2, with rad(n) = A007947(n) the squarefree kernel of n, mu(n)=A008683(n), and phi(n)= A000010(n).
Note that phi(n)/n = A076512(n)/A109395(n) = phi(rad(n))/rad(n).
Proof by principle of inclusion-exclusion.

A342866 The number of elements in the continued fraction for phi(n)/n, where phi is the Euler totient function (A000010).

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Mar 27 2021

Keywords

Examples

			a(2) = 2 since the continued fraction of phi(2)/2 = 1/2 = 0 + 1/2 has 2 elements: {0, 2}.
a(3) = 3 since the continued fraction of phi(3)/3 = 2/3 = 0 + 1/(1 + 1/2) has 3 elements: {0, 1, 2}.
a(15) = 4 since the continued fraction of phi(15)/15 = 8/15 = 0 + 1/(1 + 1/(1 + 1/7)) has 4 elements: {0, 1, 1, 7}.
		

Crossrefs

Cf. A071862 (similar, with sigma(n)/n).

Programs

  • Mathematica
    a[n_] := Length @ ContinuedFraction[EulerPhi[n]/n]; Array[a, 100]
  • PARI
    a(n) = #contfrac(eulerphi(n)/n); \\ Michel Marcus, Mar 30 2021

Formula

a(n) = 2 if and only if n is in A007694.
a(p) = 3 for an odd prime p.

A373318 Numerator of the asymptotic density of numbers that are unitarily divided by n.

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 6, 1, 2, 1, 10, 1, 12, 3, 8, 1, 16, 1, 18, 1, 4, 5, 22, 1, 4, 3, 2, 3, 28, 2, 30, 1, 20, 4, 24, 1, 36, 9, 8, 1, 40, 1, 42, 5, 8, 11, 46, 1, 6, 1, 32, 3, 52, 1, 8, 3, 4, 7, 58, 1, 60, 15, 4, 1, 48, 5, 66, 2, 44, 6, 70, 1, 72, 9, 8, 9, 60, 2, 78
Offset: 1

Views

Author

Amiram Eldar, Jun 01 2024

Keywords

Comments

Numbers that are unitarily divided by n are numbers k such that n is a unitary divisor of k, or equivalently, numbers of the form m*n, with gcd(m, n) = 1.

Examples

			Fractions begin with: 1, 1/4, 2/9, 1/8, 4/25, 1/18, 6/49, 1/16, 2/27, 1/25, 10/121, 1/36, ...
For n = 2, the numbers that are unitarily divided by 2 are the numbers of the form 4*k+2 whose asymptotic density is 1/4. Therefore a(2) = numerator(1/4) = 1.
		

Crossrefs

Numbers that are unitarily divided by k: A000027 (k=1), A016825 (k=2), A016051 (k=3), A017113 (k=4), A051062 (k=8), A051063 (k=9).

Programs

  • Mathematica
    a[n_] := Numerator[EulerPhi[n]/n^2]; Array[a, 100]
  • PARI
    a(n) = numerator(eulerphi(n)/n^2);

Formula

a(n) = 1 if and only if n is in A090778.
a(n) = A000010(n) if and only if n is a cyclic number (A003277).
Let f(n) = a(n)/A373319(n). Then:
f(n) = A000010(n)/n^2 = A076512(n)/(n*A109395(n)).
f(n) = A173557(n)/A064549(n).
f(n) is multiplicative with f(p^e) = (1 - 1/p)/p^e.
Sum_{k=1..n} f(k) = (log(n) + gamma - zeta'(2)/zeta(2)) / zeta(2), where gamma is Euler's constant (A001620).

A353347 Numbers k such that the elements of the continued fraction of phi(k)/k and phi(k+1)/(k+1) are anagrams of each other.

Original entry on oeis.org

1287, 96074, 5600160, 18486908, 41746312, 78700687, 211818591, 346666215, 535185325, 600248114, 617086359, 682116194, 972901517, 1326113558, 1397946770, 1404159416, 1785588903, 2090593128, 2286664100, 2349999964, 2396173329, 3154287487, 4029358361, 5401346573
Offset: 1

Views

Author

Amiram Eldar, Apr 15 2022

Keywords

Examples

			1287 is a term since the sequences of elements of the continued fractions of phi(1287)/1287 = 80/143 and phi(1288)/1288 = 66/161, {0, 1, 1, 3, 1, 2, 2, 2} and {0, 2, 2, 3, 1, 1, 1, 2} respectively, are anagrams of each other.
		

Crossrefs

Programs

  • Mathematica
    r[n_] := Sort[ContinuedFraction[EulerPhi[n]/n]]; seq[max_] := Module[{s = {}, n = 2, c = 0, r1 = r[1], r2}, While[n < max, r2 = r[n]; If[r1 == r2, AppendTo[s, n - 1]]; r1 = r2; n++]; s]; seq[6*10^6]

A073540 Composite numbers k such that k/phi(k) - sigma(k)/k has numerator equal to 1.

Original entry on oeis.org

4, 6, 8, 9, 16, 24, 25, 27, 28, 32, 40, 49, 64, 81, 121, 125, 128, 169, 224, 243, 256, 289, 343, 360, 361, 496, 512, 529, 625, 672, 729, 841, 864, 936, 961, 1024, 1331, 1369, 1681, 1849, 2016, 2048, 2176, 2187, 2197, 2209, 2401, 2809, 3125, 3481, 3721, 4096
Offset: 1

Views

Author

Benoit Cloitre, Aug 27 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[4100], ! PrimeQ[#] && Numerator[#/EulerPhi[#] - DivisorSigma[1, #]/#] == 1 &] (* Jayanta Basu, Jul 01 2013 *)
  • PARI
    isok(k) = if (!isprime(k), numerator(k/eulerphi(k) - sigma(k)/k) == 1); \\ Michel Marcus, May 10 2022

A260141 Numerators of the distinct common values of sigma(n)/n and m/phi(m) in the order which they occur when n and m increase.

Original entry on oeis.org

1, 3, 2, 7, 15, 7, 5, 13, 3, 65, 91, 31, 255, 31, 13, 85, 31, 35, 127, 51, 217, 1105, 403, 403, 7, 73, 221, 2555, 127, 635, 217, 527, 1651, 595, 33, 949, 133, 19, 267, 77, 511, 6851, 11, 65535, 89, 119, 665, 1397, 21845, 77, 143, 4123, 3937, 6141, 15841, 1157, 2047, 5621, 33, 1397, 15, 6141, 267
Offset: 1

Views

Author

Michel Marcus, Jul 17 2015

Keywords

Comments

To be considered as common, a value must have appeared for some N in both sequences sigma(n)/n (A017665/A017666) and n/eulerphi(n) (A109395/A076512), with 1<=n<=N.

Examples

			sigma(n)/n starts: 1/1, 3/2, 4/3, 7/4, 6/5, 2/1, 8/7, 15/8, 13/9, 9/5, ...
m/phi(m) starts:   1/1, 2/1, 3/2, 2/1, 5/4, 3/1, 7/6,  2/1,  3/2, 5/2, ...
The 1st common value is 1/1 = sigma(1)/1 = 1/eulerphi(1).
The 2nd common value is 3/2 = 3/eulerphi(3) = sigma(2)/2.
The 3rd common value is 2/1 = sigma(6)/6 = 2/eulerphi(2).
The sequence of ratios begin: 1, 3/2, 2, 7/3, 15/8, 7/4, 5/2, 13/6, 3, 65/24, 91/36, 31/10, 255/128, 31/12, ...
So this sequence begins 1, 3, 2, ...
		

Crossrefs

Cf. A259850, A260142 (denominators).

Programs

  • PARI
    already(vsv, val, vsi, n) = {pos=vecsearch(vsv, val); if (pos, until(vsv[pos] < val, pos--); pos++; pos = vsi[pos] <= n); pos;}
    lista(nn) = {vrat = [1]; vsrat = [1]; ve = vector(nn, k, k/eulerphi(k)); vs = vector(nn, k, sigma(k)/k); vesv = vecsort(ve); vesi = vecsort(ve,,1); vssv = vecsort(vs); vssi = vecsort(vs,,1); print1(1, ", "); for (n=2, nn, rn = vs[n]; if (!vecsearch(vsrat, rn) && (already(vesv, rn, vesi, n)), print1(numerator(rn), ", "); vrat = concat(vrat, rn); vsrat = vecsort(vrat,,8), rn = ve[n]; if (!vecsearch(vsrat, rn) && (already(vssv, rn, vssi, n)), print1(numerator(rn), ", "); vrat = concat(vrat, rn); vsrat = vecsort(vrat,,8););););}

A260142 Denominators of the distinct common values of sigma(n)/n and m/phi(m) in the order which they occur when n and m increase.

Original entry on oeis.org

1, 2, 1, 3, 8, 4, 2, 6, 1, 24, 36, 10, 128, 12, 4, 32, 16, 12, 42, 16, 72, 384, 120, 144, 2, 24, 64, 864, 36, 216, 60, 160, 504, 192, 16, 288, 54, 6, 128, 24, 144, 1920, 4, 32768, 32, 32, 216, 432, 8192, 20, 48, 1296, 1080, 1760, 4320, 384, 704, 1728, 10, 360, 4, 2816, 80
Offset: 1

Views

Author

Michel Marcus, Jul 17 2015

Keywords

Comments

To be considered as common, a value must have appeared for some N in both sequences sigma(n)/n (A017665/A017666) and n/eulerphi(n) (A109395/A076512), with 1<=n<=N.

Examples

			sigma(n)/n starts: 1/1, 3/2, 4/3, 7/4, 6/5, 2/1, 8/7, 15/8, 13/9, 9/5, ...
m/phi(m) starts:   1/1, 2/1, 3/2, 2/1, 5/4, 3/1, 7/6,  2/1,  3/2, 5/2, ...
The 1st common value is 1/1 = sigma(1)/1 = 1/eulerphi(1).
The 2nd common value is 3/2 = 3/eulerphi(3) = sigma(2)/2.
The 3rd common value is 2/1 = sigma(6)/6 = 2/eulerphi(2).
The sequence of ratios begin: 1, 3/2, 2, 7/3, 15/8, 7/4, 5/2, 13/6, 3, 65/24, 91/36, 31/10, 255/128, 31/12, ...
So this sequence begins 1, 2, 1, ...
		

Crossrefs

Cf. A259850, A260141 (numerators).

Programs

  • PARI
    already(vsv, val, vsi, n) = {pos=vecsearch(vsv, val); if (pos, until(vsv[pos] < val, pos--); pos++; pos = vsi[pos] <= n); pos;}
    lista(nn) = {vrat = [1]; vsrat = [1]; ve = vector(nn, k, k/eulerphi(k)); vs = vector(nn, k, sigma(k)/k); vesv = vecsort(ve); vesi = vecsort(ve,,1); vssv = vecsort(vs); vssi = vecsort(vs,,1); print1(1, ", "); for (n=2, nn, rn = vs[n]; if (!vecsearch(vsrat, rn) && (already(vesv, rn, vesi, n)), print1(denominator(rn), ", "); vrat = concat(vrat, rn); vsrat = vecsort(vrat,,8), rn = ve[n]; if (!vecsearch(vsrat, rn) && (already(vssv, rn, vssi, n)), print1(denominator(rn), ", "); vrat = concat(vrat, rn); vsrat = vecsort(vrat,,8););););}

A307964 Irregular triangle read by rows: T(n,k) = A308121(A024556(n),k).

Original entry on oeis.org

7, 14, 13, 4, 11, 2, 1, 8, 3, 6, 5, 8, 3, 2, 5, 4, -1, 2, 1, 4, 13, 26, 19, 32, 25, 38, 31, 4, 17, 10, 23, 16, 29, 2, -5, 8, 1, 14, 7, 20, 11, 22, 33, 44, 31, 18, 29, 16, 27, 38, 1, 12, 23, 34, -3, 8, 19, 6, 17, 4, -9, 2, 13, 24, 5, 10, 7, 12, 9, 14, 11, 16, 5
Offset: 1

Views

Author

Jamie Morken, Jul 29 2019

Keywords

Comments

The sequence gives odd squarefree composite rows n in A308121, i.e., rows 15, 21, 33, 35, 39, 51, 55, 57, 65, ... given by A024556(n). These rows are the primitive rows of A308121.
Row n has length A000010(A024556(n)).
For row n:
T(n, 1) = T(n, 2) / 2.
T(n, phi(n)) - T(n, phi(n)-1) = T(n, 1).
T(n, phi(n)/2+1) - T(n, phi(n)/2) = T(n, 1).
From Charlie Neder, Jul 30 2019: (Start)
For row n, T(n, k) + T(n, phi(n)-k) is constant for all k.
For 2 <= k < lpf(A024556(n)), T(n, k) = k*T(n, 1). (End)

Examples

			The sequence as an irregular triangle:
1:  7, 14, 13, 4, 11, 2, 1, 8;
2:  3, 6, 5, 8, 3, 2, 5, 4, -1, 2, 1, 4;
3:  13, 26, 19, 32, 25, 38, 31, 4, 17, 10, 23, 16, 29, 2, -5, 8, 1, 14, 7, 20;
4:  11, 22, 33, 44, 31, 18, 29, 16, 27, 38, 1, 12, 23, 34, -3, 8, 19, 6, 17, 4, -9, 2, 13, 24;
5:  5, 10, 7, 12, 9, 14, 11, 16, 5, 2, 7, 4, 9, 6, 11, 8, -3, 2, -1, 4, 1, 6, 3, 8
6:  19, 38, 25, 44, 31, 50, 37, 56, 43, 62, 49, 4, 23, 10, 29, 16, 35, 22, 41, 28, 47, 2, -11, 8, -5, 14, 1, 20, 7, 26, 13, 32;
7:  3, 6, 9, 12, 7, 10, 13, 16, 3, 6, 9, 4, 7, 10, 13, 8, 3, 6, 1, 4, 7, 10, 5, 8, 3, -2, 1, 4, 7, 2, 5, 8, -5, -2, 1, 4, -1, 2, 5, 8;
8:  7, 14, 9, 16, 11, 18, 13, 20, 15, 22, 17, 24, 7, 2, 9, 4, 11, 6, 13, 8, 15, 10, 17, 12, -5, 2, -3, 4, -1, 6, 1, 8, 3, 10, 5, 12;
9:  17, 34, 51, 68, 37, 54, 71, 88, 57, 74, 43, 12, 29, 46, 63, 32, 49, 66, 83, 4, 21, 38, 7, 24, 41, 58, 27, 44, 61, -18, -1, 16, 33, 2, 19, 36, 53, 22, -9, 8, -23, -6, 11, 28, -3, 14, 31, 48;
  ...
		

Crossrefs

Programs

  • Mathematica
    rowsToCheck = 340;
    A024556 =
    Complement[Select[Range[3, rowsToCheck, 2], SquareFreeQ],
      Prime[Range[
        PrimePi[rowsToCheck]]]]; (* after Harvey P. Dale , Jan 26 2011 *)
    A308121 =
    Table[With[{a = n/GCD[n, #], b = Numerator[#/n]},
         MapIndexed[a First@#2 - b #1 &,
          Flatten@Position[GCD[Table[Mod[k, n], {k, n - 1}], n],
             1] /. {} -> {1}]] &@EulerPhi@n, {n,
       rowsToCheck}]; (* after Michael De Vlieger, Jun 06 2019 *)
    A307964 = {};
    For[i = 1, i <= Length[A024556], i++,
    AppendTo[A307964, A308121[[A024556[[i]]]]]]
    A307964flattened = Flatten[A307964]
    (* Jamie Morken, Apr 20 2021 *)

A342867 a(n) is the least number k such that the continued fraction for phi(k)/k contains exactly n elements.

Original entry on oeis.org

1, 2, 3, 15, 35, 33, 65, 215, 221, 551, 455, 2001, 3417, 3621, 11523, 16705, 16617, 69845, 107545, 157285, 324569, 358883, 1404949, 1569295, 3783970, 3106285, 7536065, 12216295, 10589487, 24038979, 57759065, 51961945, 177005465, 131462695, 741703701, 1467144445
Offset: 1

Views

Author

Amiram Eldar, Mar 27 2021

Keywords

Comments

a(n) is the least number k such that A342866(k) = n.
All the terms above 3 are composite numbers.

Crossrefs

Cf. A071865 (similar, with sigma(k)/k).

Programs

  • Mathematica
    f[n_] := Length @ ContinuedFraction[EulerPhi[n]/n]; seq[max_] := Module[{s = Table[0, {max}], c = 0, n  = 1, i}, While[c < max, i = f[n]; If[i <= max && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[20]
  • PARI
    a(n) = my(k=1); while (#contfrac(eulerphi(k)/k) != n, k++); k; \\ Michel Marcus, Mar 30 2021

Formula

a(2) = 2 since 2 is the least number k such that A342866(k) = 2.
Previous Showing 11-20 of 21 results. Next