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-9 of 9 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)

A324055 Deficiency of Doudna-sequence: a(n) = A033879(A005940(1+n)).

Original entry on oeis.org

1, 1, 2, 1, 4, 0, 5, 1, 6, 2, 6, -4, 19, -3, 14, 1, 10, 4, 10, -2, 22, -12, 12, -12, 41, 7, 26, -19, 94, -12, 41, 1, 12, 8, 18, 0, 38, -12, 22, -10, 58, -4, 18, -48, 102, -54, 30, -28, 109, 25, 66, -17, 148, -72, 47, -51, 286, 32, 126, -64, 469, -39, 122, 1, 16, 10, 22, 4, 46, -12, 42, -8, 70, 4, 42, -56, 178, -60, 58, -26, 118, 20
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2019

Keywords

Comments

Both here and in the mirror image sequence A324185, the lowermost (asinh) scatter plot shows on the y = 0 line the numbers that correspond to the perfect numbers. Compare also to the scatter plot of A243492.

Crossrefs

See A106737, A290077, A323915, A324052, A324054, A324056, A324057, A324058, A324114, A324335, A324340, A324348, A324349, A324394, A324395 for other sequences as permuted by A005940, and compare their scatter plots.

Programs

  • Mathematica
    Array[Block[{p = Partition[Split[Join[IntegerDigits[#, 2], {2}]], 2]}, 2 # - DivisorSigma[1, #] &[Times @@ Flatten@ Table[Prime[Count[Flatten@ #, 0] + 1]^#[[1, 1]] &@ Take[p, -i], {i, Length[p]}]]] &, 82, 0] (* Michael De Vlieger, Mar 11 2019, after Robert G. Wilson v at A005940 *)
  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ From A005940
    A033879(n) = (2*n-sigma(n));
    A324055(n) = A033879(A005940(1+n));
    
  • PARI
    A324055(n) = { my(m1=2,m2=1,p=2,mp=p*p); while(n, if(!(n%2), p=nextprime(1+p); mp = p*p, m1 *= p; if(3==(n%4),mp *= p,m2 *= (mp-1)/(p-1))); n>>=1); (m1-m2); };

Formula

a(n) = A033879(A005940(1+n)).
a(n) = 2*A005940(1+n) - A324054(n).
For n > 0, a(n) = A324185(A054429(n)).
a(n) = A324348(n) + A000120(A005940(1+n)).

A324184 a(n) = sigma(A163511(n)).

Original entry on oeis.org

1, 3, 7, 4, 15, 13, 12, 6, 31, 40, 39, 31, 28, 24, 18, 8, 63, 121, 120, 156, 91, 124, 93, 57, 60, 78, 72, 48, 42, 32, 24, 12, 127, 364, 363, 781, 280, 624, 468, 400, 195, 403, 372, 342, 217, 228, 171, 133, 124, 240, 234, 248, 168, 192, 144, 96, 90, 104, 96, 72, 56, 48, 36, 14, 255, 1093, 1092, 3906, 847, 3124, 2343, 2801, 600
Offset: 0

Views

Author

Antti Karttunen, Feb 17 2019

Keywords

Crossrefs

Programs

  • PARI
    A324184(n) = if(!n,1,my(p=2,mp=p*p,m=1); while(n>1, if(n%2, p=nextprime(1+p); mp = p*p, if((2==n)||!(n%4),mp *= p,m *= (mp-1)/(p-1))); n >>= 1); (m*(mp-1)/(p-1)));
    
  • PARI
    A163511(n) = if(!n,1,my(p=2, t=1); while(n>1, if(!(n%2), (t*=p), p=nextprime(p+1)); n >>= 1); (t*p));
    A324184(n) = sigma(A163511(n));
    
  • Python
    from sympy import nextprime
    def A324184(n):
        if n:
            c, p = 1, 1
            while n:
                c *= ((p:=nextprime(p))**(s:=(~n&n-1).bit_length()+1)-1)//(p-1)
                n >>= s
            return c*(p**(s+1)-1)//(p**s-1)
        return 1 # Chai Wah Wu, Jul 25 2023

Formula

a(n) = A000203(A163511(n)).
For n >= 1, a(n) = A324054(A054429(n)).

A324200 a(n) = 2^(A000043(n)-1) * ((2^A059305(n)) - 1), where A059305 gives the prime index of the n-th Mersenne prime, while A000043 gives its exponent.

Original entry on oeis.org

6, 60, 32752, 137438953408
Offset: 1

Views

Author

Antti Karttunen, Feb 18 2019

Keywords

Comments

If there are no odd perfect numbers then these are the positions of zeros in A324185.
The next term has 314 digits:
11781361728633673532894774498354952494238773929196300355071513798753168641589311119865182769801300280680127783231251635087526446289021607771691249214388576215221396663491984443067742263787264024212477244347842938066577043117995647400274369612403653814737339068225047641453182709824206687753689912418253153056583680.

Crossrefs

Programs

Formula

a(n) = ((2^A000720(A000668(n)))-1) * 2^(A000043(n)-1) = ((2^A059305(n)) - 1) * 2^(A000043(n)-1).
If no odd perfect numbers exist, then a(n) = A243071(A000396(n)), and thus A007814(a(n)) = A007814(A000396(n)).

A324182 a(n) = A083254(A163511(n)), where A083254(n) = 2*phi(n) - n, the Möbius transform of the deficiency of n.

Original entry on oeis.org

1, 0, 0, 1, 0, 3, -2, 3, 0, 9, -6, 15, -4, 1, -2, 5, 0, 27, -18, 75, -12, 5, -10, 35, -8, 3, -14, 13, -4, 3, -2, 9, 0, 81, -54, 375, -36, 25, -50, 245, -24, 15, -70, 91, -20, 21, -14, 99, -16, 9, -42, 65, -28, -9, -22, 43, -8, 9, -18, 25, -4, 7, -2, 11, 0, 243, -162, 1875, -108, 125, -250, 1715, -72, 75, -350, 637, -100, 147, -98, 1089
Offset: 0

Views

Author

Antti Karttunen, Feb 18 2019

Keywords

Crossrefs

Cf. A054429, A083254, A163511, A324052, A324183, A324184, A324185 (compare the scatter plot), A366804 (rgs-transform).
Cf. also A324103.

Programs

Formula

a(n) = A083254(A163511(n)).
For n > 0, a(n) = A324052(A054429(n)).

A324199 Numbers n such that A324187(n) = 0.

Original entry on oeis.org

0, 6, 60, 98, 108, 928, 930, 946, 1874, 3506, 6688, 7496, 7980, 13640, 14476, 15148, 15956, 27168, 30290, 30292, 32752, 59528, 59986, 60556, 60580, 64338, 65432, 108680, 109732, 119972, 121108, 126280, 126872, 130856, 218276, 229160, 242210, 242306, 438914, 454552, 484420, 484640, 485512, 496904, 507032, 518688, 522848, 523400, 811556, 877636
Offset: 1

Views

Author

Antti Karttunen, Feb 17 2019

Keywords

Comments

Sequence A243071(A001599(k)), k >= 1, sorted into ascending order. See also comments in A324185.
Also positions of zeros in A324189.

Crossrefs

Cf. A324200 (subsequence).

Programs

  • PARI
    for(n=0,2^21,if(0==A324187(n),print1(n,", "))); \\ Uses code from A324187.

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.

A324194 A000120-deficiency of n permuted by A163511: a(n) = A192895(A163511(n)).

Original entry on oeis.org

-1, 0, 1, -1, 2, 1, 2, -1, 3, 1, 6, 0, 5, 1, 2, -2, 4, 6, 10, 0, 11, 8, 6, 1, 8, 7, 10, 3, 5, 3, 2, -2, 5, 6, 18, 7, 19, 15, 12, 1, 16, 18, 24, 6, 12, 8, 8, -1, 11, 15, 22, 6, 19, 14, 12, 3, 8, 5, 12, 1, 6, 4, 2, -2, 6, 12, 24, 11, 30, 27, 24, 8, 28, 34, 44, 17, 24, 19, 14, 3, 21, 29, 44, 22, 40, 27, 24, 9, 18, 18, 24, 10, 15, 7, 8, 0, 14, 21
Offset: 0

Views

Author

Antti Karttunen, Feb 19 2019

Keywords

Crossrefs

Programs

  • PARI
    A163511(n) = if(!n,1,my(p=2, t=1); while(n>1, if(!(n%2), (t*=p), p=nextprime(1+p)); n >>= 1); (t*p));
    A192895(n) = sumdiv(n, d, hammingweight(d)*(-1)^(d==n));
    A324194(n) = A192895(A163511(n));

Formula

a(n) = A192895(A163511(n)).
For n > 0, a(n) = A324114(A054429(n)).
Showing 1-9 of 9 results.