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

A033879 Deficiency of n, or 2n - (sum of divisors of n).

Original entry on oeis.org

1, 1, 2, 1, 4, 0, 6, 1, 5, 2, 10, -4, 12, 4, 6, 1, 16, -3, 18, -2, 10, 8, 22, -12, 19, 10, 14, 0, 28, -12, 30, 1, 18, 14, 22, -19, 36, 16, 22, -10, 40, -12, 42, 4, 12, 20, 46, -28, 41, 7, 30, 6, 52, -12, 38, -8, 34, 26, 58, -48, 60, 28, 22, 1, 46, -12, 66, 10, 42, -4, 70, -51
Offset: 1

Views

Author

Keywords

Comments

Records for the sequence of the absolute values are in A075728 and the indices of these records in A074918. - R. J. Mathar, Mar 02 2007
a(n) = 1 iff n is a power of 2. a(n) = n - 1 iff n is prime. - Omar E. Pol, Jan 30 2014
If a(n) = 1 then n is called a least deficient number or an almost perfect number. All the powers of 2 are least deficient numbers but it is not known if there exists a least deficient number that is not a power of 2. See A000079. - Jianing Song, Oct 13 2019
It is not known whether there are any -1's in this sequence. See comment in A033880. - Antti Karttunen, Feb 02 2020

Examples

			For n = 10 the divisors of 10 are 1, 2, 5, 10, so the deficiency of 10 is 10 minus the sum of its proper divisors or simply 10 - 5 - 2 - 1 = 2. - _Omar E. Pol_, Dec 27 2013
		

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section B2, pp. 74-84.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 147.

Crossrefs

Cf. A000396 (positions of zeros), A005100 (of positive terms), A005101 (of negative terms).
Cf. A083254 (Möbius transform), A228058, A296074, A296075, A323910, A325636, A325826, A325970, A325976.
Cf. A141545 (positions of a(n) = -12).
For this sequence applied to various permutations of natural numbers and some other sequences, see A323174, A323244, A324055, A324185, A324546, A324574, A324575, A324654, A325379.

Programs

Formula

a(n) = -A033880(n).
a(n) = A005843(n) - A000203(n). - Omar E. Pol, Dec 14 2008
a(n) = n - A001065(n). - Omar E. Pol, Dec 27 2013
G.f.: 2*x/(1 - x)^2 - Sum_{k>=1} k*x^k/(1 - x^k). - Ilya Gutkovskiy, Jan 24 2017
a(n) = A286385(n) - A252748(n). - Antti Karttunen, May 13 2017
From Antti Karttunen, Dec 29 2017: (Start)
a(n) = Sum_{d|n} A083254(d).
a(n) = Sum_{d|n} A008683(n/d)*A296075(d).
a(n) = A065620(A295881(n)) = A117966(A295882(n)).
a(n) = A294898(n) + A000120(n).
(End)
From Antti Karttunen, Jun 03 2019: (Start)
Sequence can be represented in arbitrarily many ways as a difference of the form (n - f(n)) - (g(n) - n), where f and g are any two sequences whose sum f(n)+g(n) = sigma(n). Here are few examples:
a(n) = A325314(n) - A325313(n) = A325814(n) - A034460(n) = A325978(n) - A325977(n).
a(n) = A325976(n) - A325826(n) = A325959(n) - A325969(n) = A003958(n) - A324044(n).
a(n) = A326049(n) - A326050(n) = A326055(n) - A326054(n) = A326044(n) - A326045(n).
a(n) = A326058(n) - A326059(n) = A326068(n) - A326067(n).
a(n) = A326128(n) - A326127(n) = A066503(n) - A326143(n).
a(n) = A318878(n) - A318879(n).
a(A228058(n)) = A325379(n). (End)
Sum_{k=1..n} a(k) ~ c * n^2, where c = 1 - Pi^2/12 = 0.177532... . - Amiram Eldar, Dec 07 2023

Extensions

Definition corrected by N. J. A. Sloane, Jul 04 2005

A324213 Number of k with 0 <= k <= sigma(n) such that n-k and 2n-sigma(n) are relatively prime.

Original entry on oeis.org

2, 4, 3, 8, 4, 2, 4, 16, 12, 9, 6, 14, 6, 12, 8, 32, 10, 26, 8, 21, 14, 18, 12, 20, 30, 16, 18, 2, 14, 24, 10, 64, 16, 24, 22, 88, 14, 30, 26, 36, 18, 32, 14, 42, 26, 28, 24, 54, 56, 80, 20, 32, 26, 40, 36, 60, 38, 42, 30, 56, 18, 42, 48, 128, 42, 48, 22, 50, 28, 72, 26, 122, 26, 54, 58, 46, 48, 56, 26, 86, 120, 60, 42, 96, 54
Offset: 1

Views

Author

Antti Karttunen and David A. Corneth, May 26 2019, with better name from Charlie Neder, Jun 02 2019

Keywords

Comments

Number of ways to form the sum sigma(n) = x+y so that n-x and n-y are coprime, with x and y in range 0..sigma(n).
From Antti Karttunen, May 28 - Jun 08 2019: (Start)
Empirically, it seems that a(n) >= A034444(n) and also that a(n) >= A034444(A000203(n)) unless n is in A000396.
Specifically, if it could be proved that a(n) >= A034444(n)/2 for n >= 2, which in turn would imply that a(n) >= A001221(n) for all n, then we would know that no odd perfect numbers could exist. Note that a(n) must be 2 on all perfect numbers, whether even or odd. See also A325819.
(End)

Examples

			For n=1, sigma(1) = 1, both gcd(1-0, 1-(1-0)) = gcd(1,0) = 1 and gcd(1-1, 1-(1-1)) = gcd(0,1) = 1, thus a(1) = 2.
--
For n=3, sigma(3) = 4, we have 5 cases to consider:
  gcd(3-0, 3-(4-0)) = 1 = gcd(3-4, 3-(4-4)),
  gcd(3-1, 3-(4-1)) = 2 = gcd(3-3, 3-(4-3)),
  gcd(3-2, 3-(4-2)) = 1,
of which three cases give 1 as a result, thus a(3) = 3.
--
For n=6, sigma(6) = 12, we have 13 cases to consider:
  gcd(6-0, 6-(12-0)) = 6 = gcd(6-12, 6-(12-12)),
  gcd(6-1, 6-(12-1)) = 5 = gcd(6-11, 6-(12-11)),
  gcd(6-2, 6-(12-2)) = 4 = gcd(6-10, 6-(12-10)),
  gcd(6-3, 6-(12-3)) = 3 = gcd(6-9, 6-(12-9)),
  gcd(6-4, 6-(12-4)) = 2 = gcd(6-8, 6-(12-8))
  gcd(6-5, 6-(12-5)) = 1 = gcd(6-7, 6-(12-7)),
  gcd(6-6, 6-(12-6)) = 0,
of which only two give 1 as a result, thus a(6) = 2.
--
For n=10, sigma(10) = 18, we have 19 cases to consider:
  gcd(10-0, 10-(18-0)) = 2 = gcd(10-18, 10-(18-18)),
  gcd(10-1, 10-(18-1)) = 1 = gcd(10-17, 10-(18-17)),
  gcd(10-2, 10-(18-2)) = 2 = gcd(10-16, 10-(18-16)),
  gcd(10-3, 10-(18-3)) = 1 = gcd(10-15, 10-(18-15)),
  gcd(10-4, 10-(18-4)) = 2 = gcd(10-14, 10-(18-14)),
  gcd(10-5, 10-(18-5)) = 1 = gcd(10-13, 10-(18-13)),
  gcd(10-6, 10-(18-6)) = 2 = gcd(10-12, 10-(18-12)),
  gcd(10-7, 10-(18-7)) = 1 = gcd(10-11, 10-(18-11)),
  gcd(10-8, 10-(18-8)) = 2 = gcd(10-10, 10-(18-10)),
  gcd(10-9, 10-(18-9)) = 1,
of which 9 cases give 1 as a result, thus a(10) = 9.
--
For n=15, sigma(15) = 24, we have 25 cases to consider:
  gcd(15-0, 15-(24-0)) = 3 = gcd(15-24, 15-(24-24)),
  gcd(15-1, 15-(24-1)) = 2 = gcd(15-23, 15-(24-23)),
  gcd(15-2, 15-(24-2)) = 1 = gcd(15-22, 15-(24-22)),
  gcd(15-3, 15-(24-3)) = 6 = gcd(15-21, 15-(24-21)),
  gcd(15-4, 15-(24-4)) = 1 = gcd(15-20, 15-(24-20)),
  gcd(15-5, 15-(24-5)) = 2 = gcd(15-19, 15-(24-19)),
  gcd(15-6, 15-(24-6)) = 3 = gcd(15-18, 15-(24-18)),
  gcd(15-7, 15-(24-7)) = 2 = gcd(15-17, 15-(24-17)),
  gcd(15-8, 15-(24-8)) = 1 = gcd(15-16, 15-(24-16)),
  gcd(15-9, 15-(24-9)) = 6 = gcd(15-15, 15-(24-15)),
  gcd(15-10, 15-(24-10)) = 1 = gcd(15-14, 15-(24-14)),
  gcd(15-11, 15-(24-11)) = 2 = gcd(15-13, 15-(24-13)),
  gcd(15-12, 15-(24-12)) = 3,
of which 2*4 = 8 cases give 1 as a result, thus a(15) = 8.
		

Crossrefs

Programs

  • Mathematica
    Array[Sum[Boole[1 == GCD[#1 - i, #1 - (#2 - i)]], {i, 0, #2}] & @@ {#, DivisorSigma[1, #]} &, 85] (* Michael De Vlieger, Jun 09 2019 *)
  • PARI
    A324213(n) = { my(s=sigma(n)); sum(i=0,s,(1==gcd(n-i,n-(s-i)))); };

Formula

a(n) = Sum_{i=0..sigma(n)} [1 == gcd(n-i,n-(sigma(n)-i))], where [ ] is the Iverson bracket and sigma(n) is A000203(n).
a(A000396(n)) = 2.
a(n) = A325815(n) + A034444(n).
a(n) = 1+A000203(n) - A325816(n).
a(A228058(n)) = A325819(n).

A325826 a(n) is the largest k <= sigma(n)-n such that k and (2n-sigma(n)) [= A033879(n)] are relatively prime.

Original entry on oeis.org

0, 1, 1, 3, 1, 1, 1, 7, 4, 7, 1, 15, 1, 9, 7, 15, 1, 20, 1, 21, 11, 13, 1, 35, 6, 13, 13, 1, 1, 41, 1, 31, 13, 19, 13, 55, 1, 21, 17, 49, 1, 53, 1, 39, 31, 23, 1, 75, 8, 43, 19, 43, 1, 65, 17, 63, 23, 31, 1, 107, 1, 33, 41, 63, 19, 77, 1, 57, 25, 73, 1, 122, 1, 39, 49, 61, 19, 89, 1, 105, 40, 43, 1, 139, 23, 43, 31, 91, 1, 143, 19, 75
Offset: 1

Views

Author

Antti Karttunen, May 29 2019

Keywords

Crossrefs

Programs

  • PARI
    A325826(n) = { my(s=sigma(n)); forstep(k=s-n, 0, -1, if(1==gcd((n+n-sigma(n)), k), return(k))); };
    
  • PARI
    A325818(n) = { my(s=sigma(n)); for(i=0, s, if(1==gcd(n-i, n-(s-i)), return(s-i))); };
    A325826(n) = (A325818(n) - n);

Formula

a(n) = A325818(n) - n = A001065(n) - A325817(n) = A325976(n) - A033879(n).
a(A000040(n)) = a(A000396(n)) = 1.
a(n) >= A325969(n).
gcd(a(n), A325976(n)) = 1.

A325960 a(n) is k-n for the least k >= n+(A020639(n)-1) such that n-k and n-(sigma(n)-k) are relatively prime, or 0 if no such k <= sigma(n) exists.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 29 2019

Keywords

Comments

By definition, if n is neither an odd prime nor an odd perfect number, then a(n) >= (A020639(n)-1).

Crossrefs

Cf. A006005 (positions of zeros, provided no odd perfect numbers exist).

Programs

  • PARI
    A020639(n) = if(1==n, n, factor(n)[1, 1]);
    A325960(n) = { my(s=sigma(n)); for(i=(-1)+n+A020639(n), s, if(1==gcd(n-i, n-(s-i)), return(i-n))); (0); };

Formula

a(n) = (A325961(n) - A325962(n)) / 2, assuming no odd perfect numbers exist.
a(2n) = 1.

A325971 a(n) is the least k >= A007947(n) such that -n + k and (n-sigma(n))+k are relatively prime.

Original entry on oeis.org

1, 2, 4, 2, 6, 7, 8, 2, 3, 11, 12, 7, 14, 15, 16, 2, 18, 7, 20, 11, 22, 23, 24, 7, 5, 27, 4, 27, 30, 31, 32, 2, 34, 35, 36, 6, 38, 39, 40, 11, 42, 43, 44, 23, 16, 47, 48, 7, 7, 10, 52, 27, 54, 7, 56, 15, 58, 59, 60, 31, 62, 63, 22, 2, 66, 67, 68, 35, 70, 71, 72, 7, 74, 75, 16, 39, 78, 79, 80, 11, 3, 83, 84, 43, 86, 87, 88, 23, 90, 31
Offset: 1

Views

Author

Antti Karttunen, May 31 2019

Keywords

Comments

a(n) is the least k >= A007947(n) such that n-k and n-(sigma(n)-k) are relatively prime.

Crossrefs

Programs

  • PARI
    A007947(n) = factorback(factorint(n)[, 1]); \\ From A007947
    A325971(n) = { my(s=sigma(n)); for(i=A007947(n), s, if(1==gcd(n-i, n-(s-i)), return(i))); (0); };
    A325971(n) = { my(s=sigma(n)); for(k=A007947(n), s, if(1==gcd(-n + k, (n-sigma(n))+k), return(k))); };

Formula

a(n) = A000203(n) - A325972(n).
a(n) = n - A325970(n).

A325972 a(n) is the largest k <= sigma(n)-A007947(n) such that n-k and n-(sigma(n)-k) are relatively prime.

Original entry on oeis.org

0, 1, 0, 5, 0, 5, 0, 13, 10, 7, 0, 21, 0, 9, 8, 29, 0, 32, 0, 31, 10, 13, 0, 53, 26, 15, 36, 29, 0, 41, 0, 61, 14, 19, 12, 85, 0, 21, 16, 79, 0, 53, 0, 61, 62, 25, 0, 117, 50, 83, 20, 71, 0, 113, 16, 105, 22, 31, 0, 137, 0, 33, 82, 125, 18, 77, 0, 91, 26, 73, 0, 188, 0, 39, 108, 101, 18, 89, 0, 175, 118, 43, 0, 181, 22
Offset: 1

Views

Author

Antti Karttunen, May 31 2019

Keywords

Crossrefs

Programs

  • PARI
    A007947(n) = factorback(factorint(n)[, 1]); \\ From A007947
    A325972(n) = { my(s=sigma(n)); forstep(i=s-A007947(n), 0, -1, if(1==gcd(n-i, n-(s-i)), return(i))); };

Formula

a(n) = A000203(n) - A325971(n).
Showing 1-6 of 6 results.