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 21-30 of 34 results. Next

A077102 Smallest number m such that GCD(a+b,a-b) = n, where a = sigma(m) and b = phi(m).

Original entry on oeis.org

4, 1, 18, 21, 200, 14, 3364, 12, 722, 328, 9801, 42, 25281, 116, 1800, 15, 36992, 810, 4414201, 88, 196, 29161, 541696, 35, 2928200, 1413, 103968, 284, 98942809, 488, 1547536, 364, 19602, 17536, 814088, 370, 49042009, 55297, 1521, 440, 3150464641
Offset: 1

Views

Author

Labos Elemer, Nov 12 2002

Keywords

Examples

			For n = 10, a(10) = 328, sigma(328) = 630, phi(328) = 160, sigma(328) + phi(328) = 790, sigma(328) - phi(328) = 470, GCD(790,470) = 10.
For n = odd number, a(n) should be either a square or twice a square and so faster search for large values is possible, like e.g., for n = 97: a(97) = 435979^2 is the smallest solution.
		

Crossrefs

Programs

  • Mathematica
    f[x_] := Apply[GCD, {DivisorSigma[1, x]+EulerPhi[x], DivisorSigma[1, x]-EulerPhi[x]}]; t=Table[0, {100}]; Do[s=f[n]; If[s<101&&t[[s]]==0, t[[s]]=n], {n, 1, 10^13}]; t
  • PARI
    lista(len) = {my(v = vector(len), c = 0, k = 1, a, b, i); while(c < len, f = factor(k); a = sigma(f); b = eulerphi(f); i = gcd(a+b,a-b); if(i <= len && v[i] == 0, c++; v[i] = k); k++); v;} \\ Amiram Eldar, Nov 14 2024

Formula

a(n) = Min{x; A077099(x) = n}.

A085122 a(n) = PrimePi(sigma(n)-phi(n)) - (PrimePi(sigma(n)) - PrimePi(phi(n))), where PrimePi = A000720, sigma = A000203 and phi = A000010.

Original entry on oeis.org

0, -1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 2, 0, 1, 1, 2, 0, 2, 0, 2, 2, 2, 0, 2, 2, 2, 3, 3, 0, 2, 0, 3, 2, 2, 3, 3, 0, 3, 4, 3, 0, 4, 0, 3, 4, 3, 0, 4, 3, 5, 3, 5, 0, 3, 3, 3, 3, 3, 0, 3, 0, 4, 3, 4, 3, 4, 0, 5, 5, 5, 0, 4, 0, 2, 5, 4, 4, 4, 0, 5, 5, 5, 0, 7, 4, 5, 4, 5, 0, 4, 3, 5, 5, 5, 5, 4, 0, 5, 5, 5, 0, 6, 0, 6, 6, 7, 0, 5, 0, 5, 6, 8, 0, 5, 5, 6, 7, 5, 5, 5, 6, 5, 6, 7, 5, 5, 0, 7
Offset: 1

Views

Author

Labos Elemer, Jul 11 2003

Keywords

Comments

Scatterplot of this sequence shows interesting strata. - Antti Karttunen, Jan 22 2020

Crossrefs

Programs

  • Mathematica
    t=Table[PrimePi[DivisorSigma[1, w]-EulerPhi[w]]- (PrimePi[DivisorSigma[1, w]]-PrimePi[EulerPhi[w]]), {w, 1, 10000}]
  • PARI
    A085122(n) = (primepi(sigma(n)-eulerphi(n)) - (primepi(sigma(n))-primepi(eulerphi(n)))); \\ Antti Karttunen, Jan 22 2020

Formula

a(n) = A000720(A051612(n)) - (A070803(n) - A070804(n)) = A000720(A051612(n)) - A085343(n). - Antti Karttunen, Jan 22 2020

Extensions

Name edited by Antti Karttunen, Jan 22 2020

A112730 Numbers k such that the equation sigma(x)-phi(x)=k has at least one solution.

Original entry on oeis.org

2, 5, 7, 10, 11, 14, 15, 16, 18, 20, 22, 23, 24, 26, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 47, 48, 50, 52, 54, 56, 59, 60, 62, 63, 64, 66, 67, 68, 72, 73, 74, 75, 76, 78, 79, 80, 83, 84, 86, 87, 88, 90, 92, 94, 95, 96, 98, 100, 102, 104, 106, 107, 108, 110, 112
Offset: 1

Views

Author

Farideh Firoozbakht, Dec 12 2005

Keywords

Comments

It is conjectured that if n>2 then all solutions of the equation sigma(x)-phi(x)=n (*) are less than or equal to (n-1)^2/4 and 2 is the only number n such that the equation (*) has infinitely many solutions. In fact in the case n=2 prime numbers are all solutions of (*). All numbers of the form 2p+1 where p is prime are in the sequence because p^2 is a solution for the equation sigma(x)-phi(x)=2p+1. All numbers of the form 3*2^n-1 are in the sequence because 2^(n+1) is a solution for the equation sigma(x)-phi(x)=3*2^n-1 and etc.
The conjecture in the previous comment was established by Luke Pebody, see the Rivera link.
Theorem (Luke Pebody): If integers n>2 and m satisfy sigma(m)-phi(m)=n then m<=(n-1)^2/4.
Proof: Case I: m=1. Then n=sigma(m)-phi(m)=0 is not more than 2.
Case II: m is prime. Then n=sigma(m)-phi(m)=(m+1)-(m-1)=2 is not more than 2.
Case III: m has at least one nontrivial divisor. Let m=pq where 1=m+p+1. Phi(m) is certainly no greater than the number of integers smaller than or equal to m that are not divisible by p. Thus phi(m)<=m-q. Thus n=sigma(m)-phi(m)>=p+q+1. Finally, the arithmetic mean of two numbers is always greater than their geometric mean, so sqrt(m)=sqrt(pq)<=(p+q)/2<=(n-1)/2. Squaring both sides, m<=(n-1)^2/4.

Examples

			5 is in the sequence because 4 is a solution to the equation sigma(x)-phi(x)=5.
		

Crossrefs

Complement of A036446.
Cf. A051612.

Programs

  • Maple
    N:= 120: # for terms <= N
    S:= {}:
    for k from 1 to (N-1)^2/4 do
      v:= numtheory:-sigma(k) - numtheory:-phi(k);
      if v > 0 and v <= N then S:= S union {v} fi;
    od:
    sort(convert(S,list)); # Robert Israel, Jul 21 2025

A228947 a(n) = sigma(n) - phi(n) - n.

Original entry on oeis.org

-1, 0, -1, 1, -3, 4, -5, 3, -2, 4, -9, 12, -11, 4, 1, 7, -15, 15, -17, 14, -1, 4, -21, 28, -14, 4, -5, 16, -27, 34, -29, 15, -5, 4, -11, 43, -35, 4, -7, 34, -39, 42, -41, 20, 9, 4, -45, 60, -34, 23, -11, 22, -51, 48, -23, 40, -13, 4, -57, 92, -59
Offset: 1

Views

Author

M. F. Hasler, Oct 05 2013

Keywords

Comments

While terms with even indices are never negative, this is the case for most terms with odd indices; exceptions are listed in A229978.

Crossrefs

Programs

  • Mathematica
    Table[DivisorSigma[1, n] - EulerPhi[n] - n, {n, 75}] (* Alonso del Arte, Oct 05 2013 *)
  • PARI
    A228947(n)=sigma(n)-eulerphi(n)-n

Formula

a(n) = 0 <=> n = 2 (conjectured).
a(2n) > 0 for all n > 1.
a(2n+1) > 0 <=> n in A229978.
a(n) = A051612(n) - n = A000203(n) - A000010(n) - n.
a(p) = 2 - p for p prime. - Alonso del Arte, Oct 05 2013
Sum_{k=1..n} a(k) = c * n^2 / 2 + O(n*log(n)), where c = Pi^2/6 - 6/Pi^2 - 1 = 0.0370069... . - Amiram Eldar, Dec 04 2023

A229978 Numbers k such that (2*k+1) + phi(2*k+1) <= sigma(2*k+1).

Original entry on oeis.org

7, 22, 31, 37, 52, 67, 82, 94, 97, 112, 115, 127, 136, 142, 148, 157, 172, 178, 187, 199, 202, 214, 217, 220, 232, 241, 247, 262, 277, 283, 292, 304, 307, 322, 325, 337, 346, 352, 367, 382, 388, 397, 409, 412, 427, 430, 442, 445, 451, 457, 472, 487, 502, 517, 532, 535, 547, 562, 577, 592, 598, 607, 622, 637, 643, 652, 661, 667, 682, 697, 712, 724, 727, 742, 757, 772, 787, 802, 808, 817
Offset: 1

Views

Author

M. F. Hasler, Oct 05 2013

Keywords

Comments

It appears that the equation x + phi(x) = sigma(x) has the unique solution x=2. It is easy to show that this is the only even solution to the equation, but for odd solutions this is less obvious. The present sequence is motivated by the observation that for most odd numbers, the l.h.s. is larger than the r.h.s. (while the opposite is the case for all even numbers). (See also formulas in A228947.)
From Amiram Eldar, Dec 23 2024: (Start)
If k is an odd abundant number (A005231), then (k-1)/2 is a term of this sequence.
The numbers of terms that do not exceed 10^k, for k = 1, 2, ..., are 1, 9, 99, 981, 9879, 98613, 984293, 9850470, 98496984, 985005850, 9850433480, ... . Apparently, the asymptotic density of this sequence exists and equals 0.0985... . (End)

Crossrefs

Cf. A000010, A000203, A005231, A051612 and references there, A228947.

Programs

  • Mathematica
    Select[Range[1000], DivisorSigma[1, 2*#+1] > EulerPhi[2*#+1] + 2*#+1 &] (* Amiram Eldar, Dec 23 2024 *)
  • PARI
    select(n->(2*n+1+eulerphi(2*n+1)
    				

A270778 Primes p such that sigma(p-1) - phi(p-1) = (3p-5)/2.

Original entry on oeis.org

3, 5, 11, 17, 257, 65537, 119831
Offset: 1

Views

Author

Jaroslav Krizek, Mar 22 2016

Keywords

Comments

Primes p such that A051612(p-1) = (3p-5)/2.
Fermat primes from A019434 are terms.
If a(8) exists, it must be larger than 10^10.
Prime terms from A270836.
Necessary condition: sigma_-1(p-1) < 2. Thus a(n)-1 is a deficient number and a(n) = 2 mod 3 for n > 1. - Charles R Greathouse IV, Apr 01 2016
If a(8) exists, it must be larger than 10^11. - Charles R Greathouse IV, Apr 01 2016
If a(8) exists, it must be larger than 10^13. - Giovanni Resta, Apr 11 2016

Examples

			17 is a term because sigma(16)-phi(16) = 31-8 = 23 = (3*17-5)/2.
		

Crossrefs

Programs

  • Magma
    [n: n in[1..10^7] | IsPrime(n) and 2*(SumOfDivisors(n-1) - EulerPhi(n-1)) eq 3*n-5]
    
  • Mathematica
    Select[Prime@ Range[10^6], DivisorSigma[1, # - 1] - EulerPhi[# - 1] == (3 # - 5)/2 &] (* Michael De Vlieger, Mar 23 2016 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if (sigma(p-1) - eulerphi(p-1) == (3*p-5)/2, print1(p, ", "))); \\ Michel Marcus, Mar 23 2016
    
  • PARI
    is(n)=my(f=factor(n-1)); sigma(f) - eulerphi(f) == (3*n-5)/2 && isprime(n) \\ Charles R Greathouse IV, Apr 01 2016

A292771 If sigma(n)-phi(n) is even then (sigma(n)-phi(n))/2 otherwise -1.

Original entry on oeis.org

0, 1, 1, -1, 1, 5, 1, -1, -1, 7, 1, 12, 1, 9, 8, -1, 1, -1, 1, 17, 10, 13, 1, 26, -1, 15, 11, 22, 1, 32, 1, -1, 14, 19, 12, -1, 1, 21, 16, 37, 1, 42, 1, 32, 27, 25, 1, 54, -1, -1, 20, 37, 1, 51, 16, 48, 22, 31, 1, 76, 1, 33, 34, -1, 18, 62, 1, 47, 26, 60, 1, -1, 1, 39, 42, 52, 18, 72, 1, 77, -1, 43, 1
Offset: 1

Views

Author

N. J. A. Sloane, Sep 28 2017

Keywords

Comments

a(n) = 1 if and only if n is prime. - Robert Israel, Sep 28 2017

Crossrefs

Programs

  • Maple
    f:= proc(n) local v;
       v:= numtheory:-sigma(n)-numtheory:-phi(n);
       if v::even then v/2 else -1 fi
    end proc:
    map(f, [$1..100]); # Robert Israel, Sep 28 2017

A324048 a(n) = A000203(n) - A083254(n) = n + sigma(n) - 2*phi(n).

Original entry on oeis.org

0, 3, 3, 7, 3, 14, 3, 15, 10, 20, 3, 32, 3, 26, 23, 31, 3, 45, 3, 46, 29, 38, 3, 68, 16, 44, 31, 60, 3, 86, 3, 63, 41, 56, 35, 103, 3, 62, 47, 98, 3, 114, 3, 88, 75, 74, 3, 140, 22, 103, 59, 102, 3, 138, 47, 128, 65, 92, 3, 196, 3, 98, 95, 127, 53, 170, 3, 130, 77, 166, 3, 219, 3, 116, 119, 144, 53, 198, 3, 202, 94, 128, 3
Offset: 1

Views

Author

Antti Karttunen, Feb 13 2019

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := n + DivisorSigma[1, n] - 2 * EulerPhi[n]; Array[a, 100] (* Amiram Eldar, Dec 04 2023 *)
  • PARI
    A083254(n) = (2*eulerphi(n)-n);
    A324048(n) = (sigma(n) - A083254(n));
    
  • PARI
    a(n) = {my(f = factor(n)); n + sigma(f) - 2*eulerphi(f);} \\ Amiram Eldar, Dec 04 2023

Formula

a(n) = A000203(n) - A083254(n) = n + A000203(n) - 2*A000010(n).
a(n) = A051612(n) + A051953(n).
a(n) = A297159(n) + 2*A001065(n).
Sum_{k=1..n} a(k) = (Pi^2/12 - 6/Pi^2 + 1/2) * n^2 + O(n*log(n)). - Amiram Eldar, Dec 04 2023

A353276 a(n) = phi(n) + tau(n)^omega(n) - sigma(n).

Original entry on oeis.org

1, 0, 0, -2, 0, 6, 0, -7, -4, 2, 0, 12, 0, -2, 0, -18, 0, 3, 0, 2, -4, -10, 0, 12, -8, -14, -18, -8, 0, 448, 0, -41, -12, -22, -8, 2, 0, -26, -16, -10, 0, 428, 0, -28, -18, -34, 0, -8, -12, -37, -24, -38, 0, -38, -16, -32, -28, -46, 0, 1576, 0, -50, -32, -88, -20, 388, 0, -58, -36, 392, 0, -27, 0, -62, -48, -68, -20, 368
Offset: 1

Views

Author

Antti Karttunen, Apr 27 2022

Keywords

Crossrefs

Cf. A110087 (positions of negative terms), A110086 (of terms >= 0), A110085 (of terms > 0).

Programs

  • Mathematica
    Array[#1 + #3^#2 - #4 & @@ Flatten@ {EulerPhi[#], PrimeNu[#], DivisorSigma[{0, 1}, #]} &, 78] (* Michael De Vlieger, Apr 27 2022 *)
  • PARI
    A353276(n) = (eulerphi(n) + (numdiv(n)^omega(n)) - sigma(n));

Formula

a(n) = A110088(n) - A051612(n) = A000010(n) + A000005(n)^A001221(n) - A000203(n).
a(p) = 0 for all primes p.

A226586 Odd values of sigma(n) - phi(n) in the order of appearance and with repetition.

Original entry on oeis.org

5, 11, 7, 23, 33, 11, 47, 79, 15, 73, 95, 171, 67, 129, 177, 23, 191, 355, 309, 27, 315, 385, 283, 289, 383, 723, 35, 739, 393, 39, 687, 801, 489, 1089, 711, 767, 47, 1459, 649, 281, 1599, 969, 801, 607, 1431, 1633, 59, 1971, 2581, 63, 1555, 1535, 1153, 1069, 2931, 1605, 927, 1843, 3319, 2121
Offset: 1

Views

Author

Wesley Ivan Hurt, Jun 28 2013

Keywords

Comments

Odd values of A051612(n) sorted along n.

Crossrefs

Programs

  • Maple
    select(type, [seq(numtheory:-sigma(n)-numtheory:-phi(n), n=1..2000)], odd); # Robert Israel, Aug 11 2019
  • Mathematica
    Select[Table[DivisorSigma[1,n]-EulerPhi[n],{n,2000}],OddQ] (* Harvey P. Dale, Sep 27 2013 *)

Formula

sigma(4) - phi(4) = 7 - 2 = 5. Since 5 is the first odd value of sigma(n) - phi(n), it appears first in the list. So a(1) = 5.
Previous Showing 21-30 of 34 results. Next