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-10 of 13 results. Next

A323168 Lexicographically earliest sequence such that for all i, j, a(i) = a(j) => f(i) = f(j), where f(n) = [A322867(n), A323174(n)] for n > 1, and f(1) = 0.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 5, 6, 7, 2, 3, 2, 8, 9, 10, 2, 11, 2, 12, 13, 14, 2, 15, 16, 17, 18, 19, 2, 20, 2, 21, 22, 23, 20, 21, 2, 24, 25, 26, 2, 27, 2, 28, 29, 30, 2, 31, 32, 33, 34, 35, 2, 36, 37, 38, 39, 40, 2, 41, 2, 42, 43, 44, 45, 46, 2, 47, 48, 49, 2, 50, 2, 51, 52, 53, 54, 55, 2, 15, 32, 56, 2, 57, 58, 59, 60, 61, 2, 62, 63, 64, 65, 66, 67, 21, 2, 68, 69, 70, 2, 71, 2, 57
Offset: 1

Views

Author

Antti Karttunen, Jan 10 2019

Keywords

Comments

Restricted growth sequence transform of function f, with f(1) = 0 and f(n) = [A322867(n), A323174(n)] for n > 1.
Equally, restricted growth sequence transform of function f, with f(1) = 0 and f(n) = A318310(A122111(n)) for n > 1.
For all i, j:
a(i) = a(j) => A322867(i) = A322867(j),
a(i) = a(j) => A323167(i) = A323167(j),
a(i) = a(j) => A323174(i) = A323174(j).

Crossrefs

Programs

  • PARI
    up_to = 4096;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    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)};
    A122111(n) = if(1==n,n,prime(bigomega(n))*A122111(A064989(n)));
    A005187(n) = { my(s=n); while(n>>=1, s+=n); s; };
    A294898(n) = (A005187(n)-sigma(n));
    A318310aux(n) = [hammingweight(n), A294898(n)];
    A323168aux(n) = if(1==n,0,A318310aux(A122111(n)));
    v323168 = rgs_transform(vector(up_to, n, A323168aux(n)));
    A323168(n) = v323168[n];

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

A323173 Sum of divisors computed for conjugated prime factorization: a(n) = A000203(A122111(n)).

Original entry on oeis.org

1, 3, 7, 4, 15, 12, 31, 6, 13, 28, 63, 18, 127, 60, 39, 8, 255, 24, 511, 42, 91, 124, 1023, 24, 40, 252, 31, 90, 2047, 72, 4095, 12, 195, 508, 120, 32, 8191, 1020, 403, 56, 16383, 168, 32767, 186, 93, 2044, 65535, 36, 121, 78, 819, 378, 131071, 48, 280, 120, 1651, 4092, 262143, 96, 524287, 8188, 217, 14, 600, 360, 1048575, 762, 3315, 234
Offset: 1

Views

Author

Antti Karttunen, Jan 10 2019

Keywords

Crossrefs

Programs

  • Mathematica
    A122111[n_] := Product[Prime[Sum[If[j < i, 0, 1], {j, #}]], {i, Max[#]}]&[ Flatten[Table[Table[PrimePi[f[[1]]], {f[[2]]}], {f, FactorInteger[n]}]]];
    a[n_] := With[{k = A122111[n]}, DivisorSigma[1, k]];
    Array[a, 70] (* Jean-François Alcover, Sep 23 2020 *)
  • 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)};
    A122111(n) = if(1==n,n,prime(bigomega(n))*A122111(A064989(n)));
    A323173(n) = sigma(A122111(n));

Formula

a(n) = A000203(A122111(n)).
a(n) = 2*A122111(n) - A323174(n).
a(n) = A322819(n) * A038712(A122111(n)).

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

A324574 a(1) = 0; for n > 1, a(n) = A033879(A087207(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 08 2019

Keywords

Comments

As A087207 is a surjective function that toggles the parity, it follows that if it can be proved/disproved that a(n) = 0 for some/any even n, then it also proves/disproves the existence of odd perfect numbers.
The positions (n > 1) of zeros in squarefree n, 15, 385, ..., can be obtained as A019565(A000396(n)).

Crossrefs

Programs

Formula

a(1) = 0; for n > 1, a(n) = A033879(A087207(n)).
a(n) = a(A007947(n)) = A324575(A007947(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.

A323903 a(n) = A002487(A122111(n)).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 3, 4, 2, 1, 3, 1, 2, 4, 3, 1, 4, 1, 3, 4, 2, 1, 3, 8, 2, 7, 3, 1, 4, 1, 5, 4, 2, 8, 8, 1, 2, 4, 3, 1, 4, 1, 3, 7, 2, 1, 5, 14, 12, 4, 3, 1, 9, 8, 3, 4, 2, 1, 8, 1, 2, 7, 5, 8, 4, 1, 3, 4, 12, 1, 6, 1, 2, 18, 3, 14, 4, 1, 5, 9, 2, 1, 8, 8, 2, 4, 3, 1, 9, 14, 3, 4, 2, 8, 5, 1, 16, 7, 6, 1, 4, 1, 3, 18
Offset: 1

Views

Author

Antti Karttunen, Feb 09 2019

Keywords

Crossrefs

Programs

  • PARI
    A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487
    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)};
    A122111(n) = if(1==n,n,prime(bigomega(n))*A122111(A064989(n)));
    A323903(n) = A002487(A122111(n));

Formula

a(n) = A002487(A122111(n)) = A002487(A322865(n)).
a(p) = 1 for all primes p.

A324654 a(n) = A033879(A276086(n)).

Original entry on oeis.org

1, 1, 2, 0, 5, -3, 4, 2, 6, -12, 12, -54, 19, 7, 26, -72, 47, -309, 94, 32, 126, -372, 222, -1584, 469, 157, 626, -1872, 1097, -7959, 6, 4, 10, -12, 22, -60, 22, -4, 18, -156, 6, -612, 102, -44, 58, -876, -74, -3372, 502, -244, 258, -4476, -474, -17172, 2502, -1244, 1258, -22476, -2474, -86172, 41, 25, 66, -96, 141, -459, 148, -46, 102
Offset: 0

Views

Author

Antti Karttunen, Mar 10 2019

Keywords

Comments

Interestingly, this kind of sampling of deficiency (A033879; recall that the range of A276086 does not cover the whole N) biases it strongly towards negative values: of the first 2310 terms, 1565 are negative (~ 68%) and of the first 30030 terms, 22507 are negative (~ 75%). Compare also to A323174, which covers whole N.

Crossrefs

Programs

  • PARI
    A276086(n) = { my(i=0,m=1,pr=1,nextpr); while((n>0),i=i+1; nextpr = prime(i)*pr; if((n%nextpr),m*=(prime(i)^((n%nextpr)/pr));n-=(n%nextpr));pr=nextpr); m; };
    A033879(n) = (2*n-sigma(n));
    A324654(n) = A033879(A276086(n));

Formula

a(n) = A033879(A276086(n)).
a(n) = 2*A276086(n) - A324653(n).
Showing 1-10 of 13 results. Next