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. 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

A323244 a(1) = 0; and for n > 1, a(n) = A033879(A156552(n)).

Original entry on oeis.org

0, 1, 1, 2, 1, 4, 1, 6, 0, 5, 1, 10, 1, 16, 2, 6, 1, 12, 1, 18, -3, 18, 1, 22, -4, 46, 4, 22, 1, 10, 1, 30, 14, 82, -2, 14, 1, 256, -12, 22, 1, 36, 1, 66, 8, 226, 1, 46, -12, 19, 8, 130, 1, 28, -19, 70, -12, 748, 1, 42, 1, 1362, 16, 22, 10, 42, 1, 214, 254, 40, 1, 38, 1, 3838, 10, 406, -10, 106, 1, 78, -12, 5458, 1, 26, -72, 12250, -348, 30, 1, 12
Offset: 1

Views

Author

Antti Karttunen, Jan 10 2019

Keywords

Comments

After a(1) = 0, the other zeros occur for k >= 1, at A005940(1+A000396(k)), which, provided no odd perfect numbers exist, is equal to A324201(k) = A062457(A000043(k)): 9, 125, 161051, 410338673, ..., etc.
There are 2321 negative terms among the first 10000 terms.

Crossrefs

Cf. A324201 (positions of zeros, conjectured), A324551 (of negative terms), A324720 (of nonnegative terms), A324721 (of positive terms), A324731, A324732.
Cf. A329644 (Möbius transform).
Cf. A323174, A324055, A324185, A324546 for other permutations of deficiency, and also A324574, A324575, A324654.

Programs

  • Mathematica
    Array[2 # - If[# == 0, 0, DivisorSigma[1, #]] &@ Floor@ Total@ Flatten@ MapIndexed[#1 2^(#2 - 1) &, Flatten[Table[2^(PrimePi@ #1 - 1), {#2}] & @@@ FactorInteger@ #]] &, 90] (* Michael De Vlieger, Apr 21 2019 *)
  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n))));
    A323244(n) = if(1==n, 0, my(k=A156552(n)); (2*k)-sigma(k));
    
  • Python
    from sympy import divisor_sigma, primepi, factorint
    def A323244(n): return (lambda n: (n<<1)-divisor_sigma(n))(sum((1< 1 else 0 # Chai Wah Wu, Mar 10 2023

Formula

a(n) = 2*A156552(n) - A323243(n).
a(1) = 0; and for n > 1, a(n) = A033879(A156552(n)).
a(n) = A323248(n) + A001222(n) = (A323247(n) - A323243(n)) + A001222(n).
From Antti Karttunen, Mar 12 2019 & Nov 23 2019: (Start)
a(n) = Sum_{d|n} (2*A297112(d) - A324543(d)) = Sum_{d|n} A329644(d).
A002487(a(n)) = A324115(n).
a(n) = A329638(n) - A329639(n).
a(n) = A329645(n) - A329646(n).
(End)

A324546 An analog of deficiency (A033879) for nonstandard factorization based on the sieve of Eratosthenes (A083221).

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, 14, 8, 22, -12, 19, 10, 10, 0, 28, -12, 30, 1, 12, 14, 22, -19, 36, 16, 18, -10, 40, -12, 42, 4, 41, 20, 46, -28, 41, 7, 26, 6, 52, -12, 94, -8, 22, 26, 58, -48, 60, 28, 22, 1, 38, -54, 66, 10, 30, -4, 70, -51, 72, 34, 30, 12, 58, -12, 78, -26, 42, 38, 82, -64, 102, 40, 18, -4, 88
Offset: 1

Views

Author

Antti Karttunen, Mar 06 2019

Keywords

Comments

Even positions for zeros is given by the even terms of A000396, because they are among the fixed points of permutation A250246. Whether there are any zeros in odd positions depends on whether there are any odd perfect numbers. If such zeros exist, they would not necessarily be in the same positions as in A033879.

Crossrefs

Programs

  • PARI
    up_to = 65539;
    ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
    A020639(n) = if(n>1, if(n>n=factor(n, 0)[1, 1], n, factor(n)[1, 1]), 1); \\ From A020639
    A055396(n) = if(1==n,0,primepi(A020639(n)));
    v078898 = ordinal_transform(vector(up_to,n,A020639(n)));
    A078898(n) = v078898[n];
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
    A250246(n) = if(1==n,n,my(k = 2*A250246(A078898(n)), r = A055396(n)); if(1==r, k, while(r>1, k = A003961(k); r--); (k)));
    A324546(n) = { my(k=A250246(n)); (k+k - sigma(k)); };

Formula

a(n) = A033879(A250246(n)) = 2*A250246(n) - A324545(n).
a(n) = A250246(n) - A324535(n).

A324573 a(1) = 0; for n > 1, a(n) = sigma(A048675(n)).

Original entry on oeis.org

0, 1, 3, 3, 7, 4, 15, 4, 7, 6, 31, 7, 63, 13, 12, 7, 127, 6, 255, 12, 18, 18, 511, 6, 15, 48, 12, 18, 1023, 8, 2047, 6, 39, 84, 28, 12, 4095, 176, 54, 8, 8191, 12, 16383, 39, 15, 258, 32767, 12, 31, 13, 144, 54, 65535, 8, 42, 12, 252, 800, 131071, 15, 262143, 1302, 28, 12, 91, 20, 524287, 144, 528, 14, 1048575, 8, 2097151, 2736, 18
Offset: 1

Views

Author

Antti Karttunen, Mar 08 2019

Keywords

Crossrefs

Programs

  • PARI
    A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; };
    A324573(n) = if(1==n,0,sigma(A048675(n)));

Formula

a(1) = 0; for n > 1, a(n) = A000203(A048675(n)).

A324575 a(1) = 0; for n > 1, a(n) = A033879(A048675(n)).

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 2, 1, 4, 1, 1, 1, 5, 0, 1, 1, 4, 1, 0, 2, 16, 1, 4, 1, 18, 0, 2, 1, 6, 1, 4, -3, 46, -4, 0, 1, 82, 14, 6, 1, 10, 1, -3, 1, 256, 1, 0, 1, 5, -12, 14, 1, 6, -2, 10, 8, 226, 1, 1, 1, 748, -4, 0, -19, 18, 1, -12, -12, 12, 1, 6, 1, 1362, 2, 8, -12, 22, 1, 1, 1, 3838, 1, -4, 10, 5458, 254, 18, 1, 5, -10, -12, -348, 12250
Offset: 1

Views

Author

Antti Karttunen, Mar 07 2019

Keywords

Crossrefs

Programs

Formula

a(1) = 0; for n > 1, a(n) = A033879(A048675(n)).
a(n) = 2*A048675(n) - A324573(n).
a(A007947(n)) = A324574(n).
a(p) = 1 for all primes p.

A331734 a(n) = A033879(A225546(n)).

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 0, 5, 1, 1, -4, 1, 1, 1, 4, 1, -3, 1, -28, 1, 1, 1, -12, 41, 1, -19, -508, 1, 1, 1, 2, 1, 1, 1, 14, 1, 1, 1, -60, 1, 1, 1, -131068, -115, 1, 1, -2, 3281, -39, 1, -8589934588, 1, -51, 1, -1020, 1, 1, 1, -124, 1, 1, -2035, 6, 1, 1, 1, -36893488147419103228, 1, 1, 1, -12, 1, 1, -199, -680564733841876926926749214863536422908
Offset: 1

Views

Author

Antti Karttunen, Feb 02 2020

Keywords

Crossrefs

Cf. A323244, A323174, A324055, A324185, A324546 for other permutations of the deficiency, and also A324574, A324654.

Programs

  • PARI
    A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; };
    A331734(n) = if(issquarefree(n),1,my(f=factor(n),u=#binary(vecmax(f[, 2])),prods=vector(u,x,1),m=1,e); for(i=1,u,for(k=1,#f~, if(bitand(f[k,2],m),prods[i] *= f[k,1])); m<<=1); (2*prod(i=1,u,prime(i)^A048675(prods[i]))) - prod(i=1,u,(prime(i)^(1+A048675(prods[i]))-1)/(prime(i)-1)));

Formula

a(n) = A033879(A225546(n)) = 2*A225546(n) - A331733(n).
For all n, a(A005117(n)) = 1. [It is not known if there are 1's in any other positions. See Jianing Song's Oct 13 2019 comment in A033879.]
For a necessary condition that a(s) would be zero for any square, see A331741.
Showing 1-6 of 6 results.