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

A296071 a(n) = Product_{d|n, dA019565(A289813(A295882(d))); a product obtained from the 1's present in balanced ternary representation of the deficiencies of the proper divisors of n.

Original entry on oeis.org

1, 2, 2, 4, 2, 12, 2, 8, 6, 24, 2, 24, 2, 20, 36, 16, 2, 60, 2, 144, 30, 40, 2, 48, 12, 60, 30, 240, 2, 1080, 2, 32, 60, 56, 60, 120, 2, 28, 90, 576, 2, 3600, 2, 400, 900, 168, 2, 96, 10, 1008, 84, 1200, 2, 420, 120, 480, 42, 56, 2, 4320, 2, 84, 1500, 64, 180, 4200, 2, 784, 252, 90720, 2, 1200, 2, 140, 2520, 784, 100, 75600, 2, 1152, 210, 840, 2
Offset: 1

Views

Author

Antti Karttunen, Dec 04 2017

Keywords

Comments

Used as a part of filter A296073.

Crossrefs

Programs

  • PARI
    A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
    A117967(n) = if(n<=1,n,if(!(n%3),3*A117967(n/3),if(1==(n%3),1+3*A117967((n-1)/3),2+3*A117967((n+1)/3))));
    A117968(n) = if(1==n,2,if(!(n%3),3*A117968(n/3),if(1==(n%3),2+3*A117968((n-1)/3),1+3*A117968((n+1)/3))));
    A289813(n) = { my (d=digits(n, 3)); from digits(vector(#d, i, if (d[i]==1, 1, 0)), 2); } \\ From Rémy Sigrist
    A295882(n) = { my(x = (2*n)-sigma(n)); if(x >= 0,A117967(x),A117968(-x)); };
    A296071(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A289813(A295882(d))))); m; };
    
  • Scheme
    (define (A296071 n) (let loop ((m 1) (props (proper-divisors n))) (cond ((null? props) m) (else (loop (* m (A019565 (A289813 (A295882 (car props))))) (cdr props))))))
    (define (proper-divisors n) (reverse (cdr (reverse (divisors n)))))
    (define (divisors n) (let loop ((k n) (divs (list))) (cond ((zero? k) divs) ((zero? (modulo n k)) (loop (- k 1) (cons k divs))) (else (loop (- k 1) divs)))))

Formula

a(n) = Product_{d|n, dA019565(A289813(A295882(d))).

A296072 a(n) = Product_{d|n, dA019565(A289814(A295882(d))); a product obtained from the -1's present in balanced ternary representation of the deficiencies of the proper divisors of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 3, 2, 1, 1, 12, 1, 2, 6, 1, 1, 12, 1, 1, 12, 3, 1, 12, 1, 1, 2, 15, 3, 216, 1, 5, 2, 6, 1, 6, 1, 2, 36, 5, 1, 180, 3, 10, 30, 1, 1, 1080, 1, 3, 10, 1, 1, 3240, 1, 1, 36, 1, 1, 20, 1, 450, 10, 30, 1, 45360, 1, 1, 30, 75, 3, 10, 1, 60, 360, 1, 1, 540, 15, 105, 2, 2, 1, 3240, 3, 50, 2, 35, 5, 2520, 1, 630, 60, 90, 1, 900
Offset: 1

Views

Author

Antti Karttunen, Dec 04 2017

Keywords

Comments

Used as a part of filter A296073.

Crossrefs

Programs

  • PARI
    A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
    A117967(n) = if(n<=1,n,if(!(n%3),3*A117967(n/3),if(1==(n%3),1+3*A117967((n-1)/3),2+3*A117967((n+1)/3))));
    A117968(n) = if(1==n,2,if(!(n%3),3*A117968(n/3),if(1==(n%3),2+3*A117968((n-1)/3),1+3*A117968((n+1)/3))));
    A289814(n) = { my (d=digits(n, 3)); from digits(vector(#d, i, if (d[i]==2, 1, 0)), 2); } \\ From Rémy Sigrist
    A295882(n) = { my(x = (2*n)-sigma(n)); if(x >= 0,A117967(x),A117968(-x)); };
    A296072(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A289814(A295882(d))))); m; };
    
  • Scheme
    (define (A296072 n) (let loop ((m 1) (props (proper-divisors n))) (cond ((null? props) m) (else (loop (* m (A019565 (A289814 (A295882 (car props))))) (cdr props))))))
    (define (proper-divisors n) (reverse (cdr (reverse (divisors n)))))
    (define (divisors n) (let loop ((k n) (divs (list))) (cond ((zero? k) divs) ((zero? (modulo n k)) (loop (- k 1) (cons k divs))) (else (loop (- k 1) divs)))))

Formula

a(n) = Product_{d|n, dA019565(A289814(A295882(d))).

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

A318310 Lexicographically earliest infinite sequence such that a(i) = a(j) => A000120(i) = A000120(j) and A033879(i) = A033879(j), for all i, j >= 0.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 25 2018

Keywords

Comments

Restricted growth sequence transform of ordered pair [A000120(n), A033879(n)], or equally, of ordered pair [A000120(n), A294898(n)].
For all i, j:
A318311(i) = A318311(j) => a(i) = a(j),
a(i) = a(j) => A286449(i) = A286449(j),
a(i) = a(j) => A294898(i) = A294898(j).
In the scatter plot one can see the effects of both base-2 related A000120 (binary weight of n) and prime factorization related A033879 (deficiency of n) graphically mixed: from the former, a square grid pattern, and from the latter the black rays that emanate from the origin. The same is true for A323898, while in the ordinal transform of this sequence, A331184, such effects are harder to visually discern. - Antti Karttunen, Jan 13 2020

Crossrefs

Cf. A318311, A323889, A323892, A323898, A324344, A324380, A324390 for similar constructions.
Cf. A331184 (ordinal transform).

Programs

  • PARI
    up_to = 65537;
    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; };
    A318310aux(n) = [hammingweight(n), (2*n) - sigma(n)];
    v318310 = rgs_transform(vector(up_to,n,A318310aux(n)));
    A318310(n) = v318310[n];

Extensions

Name changed by Antti Karttunen, Jan 13 2020

A296073 Filter combining A296071(n) and A296072(n), related to the deficiencies of proper divisors of n.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 5, 6, 7, 2, 8, 2, 9, 10, 11, 2, 12, 2, 13, 14, 15, 2, 16, 17, 18, 19, 20, 2, 21, 2, 22, 23, 24, 25, 26, 2, 27, 28, 29, 2, 30, 2, 31, 32, 33, 2, 34, 35, 36, 37, 38, 2, 39, 40, 41, 42, 43, 2, 44, 2, 45, 46, 47, 48, 49, 2, 50, 51, 52, 2, 53, 2, 54, 55, 56, 57, 58, 2, 59, 60, 61, 2, 62, 63, 64, 65, 66, 2, 67, 68, 69, 70, 71, 72, 73, 2, 74, 75, 76, 2, 77, 2, 78, 79, 80, 2, 81, 2, 82, 83, 84, 2, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 33
Offset: 1

Views

Author

Antti Karttunen, Dec 04 2017

Keywords

Comments

Construction: Pack the values of A296071(n) and A296072(n) to a single value with any injective N x N -> N packing function, like for example as f(n) = (1/2)*(2 + ((A296071(n)+A296072(n))^2) - A296071(n) - 3*A296072(n)) (the packing function here is the two-argument form of A000027). Then apply the restricted growth sequence transform to the sequence f(1), f(2), f(3), ... The transform assigns a unique increasing number for each newly encountered term of the sequence, and for any subsequent occurrences of the same term it gives the same number that term obtained for the first time.
For all i, j: a(i) = a(j) => A296074(i) = A296074(j).
Note that this is NOT restricted growth transform of A239968, which is A305800. Apart from 2's that occur at every prime, there are other duplicates also, first at a(125) = a(46) = 33.

Examples

			To see that a(46) and a(125) have the same value (33), consider the proper divisors of 46 = 1, 2, 23 and of 125 = 1, 5, 25. Their deficiencies are 1, 1, 22 and 1, 4, 19 respectively. When we look at their balanced ternary representations [as here all elements are positive, it can be obtained as A007089(A117967(n)) with 2's standing for -1's]:
   1 =    1
   1 =    1
  22 = 1211 (as 22 = 1*(3^3) + -1*(3^2) + 1*(3^1) + 1*(3^0))
and
   1 =    1
   4 =   11
  19 = 1201 (as 19 = 1*(3^3) + -1*(3^2) + 0*(3^1) + 1*(3^0)).
we see that in each column there is an equal number of 1's and an equal number of 2's. Moreover, this then implies also that the sums of those two sequences of deficiencies {1, 1, 22} and {1, 4, 19} are equal, as A296074(n) is a function of (can be computed from) a(n).
		

Crossrefs

Cf. also A293226.
Differs from A305800 for the first time at n=125.

Programs

  • PARI
    up_to = 65536;
    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; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
    A117967(n) = if(n<=1,n,if(!(n%3),3*A117967(n/3),if(1==(n%3),1+3*A117967((n-1)/3),2+3*A117967((n+1)/3))));
    A117968(n) = if(1==n,2,if(!(n%3),3*A117968(n/3),if(1==(n%3),2+3*A117968((n-1)/3),1+3*A117968((n+1)/3))));
    A289813(n) = { my (d=digits(n, 3)); from digits(vector(#d, i, if (d[i]==1, 1, 0)), 2); } \\ From Rémy Sigrist
    A289814(n) = { my (d=digits(n, 3)); from digits(vector(#d, i, if (d[i]==2, 1, 0)), 2); } \\ From Rémy Sigrist
    A295882(n) = { my(x = (2*n)-sigma(n)); if(x >= 0,A117967(x),A117968(-x)); };
    A296071(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A289813(A295882(d))))); m; };
    A296072(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A289814(A295882(d))))); m; };
    Anotsubmitted3(n) = (1/2)*(2 + ((A296071(n)+A296072(n))^2) - A296071(n) - 3*A296072(n));
    write_to_bfile(1,rgs_transform(vector(up_to,n,Anotsubmitted3(n))),"b296073.txt");

Extensions

Data section extended up to a(125) by Antti Karttunen, Jun 14 2018

A295881 Reversing binary representation of the deficiency of n, A033879(n).

Original entry on oeis.org

1, 1, 2, 1, 4, 0, 14, 1, 13, 2, 26, 12, 28, 4, 14, 1, 16, 5, 50, 6, 26, 8, 62, 20, 55, 26, 22, 0, 44, 20, 38, 1, 50, 22, 62, 53, 100, 16, 62, 30, 104, 20, 122, 4, 28, 52, 118, 36, 121, 11, 38, 14, 84, 20, 110, 24, 98, 42, 74, 80, 76, 44, 62, 1, 118, 20, 194, 26, 122, 12, 206, 85, 200, 98, 42, 28, 74, 20, 214, 46, 121
Offset: 1

Views

Author

Antti Karttunen, Dec 04 2017

Keywords

Comments

For all n, A010060(a(A005100(n))) = 1 and A010060(a(A023196(n))) = 0. That is, for the deficient numbers a(n) is an odious number (A000069) and for the nondeficient numbers a(n) is an evil number (A001969).

Crossrefs

Cf. A000396 (gives the positions of zeros).

Programs

Formula

If A033879(n) <= 0, a(n) = A048724(-A033879(n)), otherwise a(n) = A065621(A033879(n)).
For all n >= 1, A065620(a(n)) = A033879(n).

A297154 Balanced ternary representation of A083254(n), 2*phi(n)-n.

Original entry on oeis.org

1, 0, 1, 0, 3, 7, 17, 0, 3, 7, 9, 8, 14, 7, 1, 0, 51, 21, 47, 8, 3, 7, 48, 19, 51, 7, 9, 8, 27, 67, 32, 0, 16, 7, 13, 24, 38, 7, 9, 19, 39, 63, 161, 8, 3, 7, 153, 68, 38, 20, 13, 8, 141, 63, 34, 19, 51, 7, 138, 56, 152, 7, 9, 0, 31, 55, 149, 8, 46, 71, 105, 57, 101, 7, 17, 8, 160, 60, 89, 68, 27, 7, 81, 72, 160, 7
Offset: 1

Views

Author

Antti Karttunen, Dec 26 2017

Keywords

Crossrefs

Programs

Formula

If A083254(n) >= 0, then a(n) = A117967(A083254(n)), otherwise a(n) = A117968(-A083254(n)).
For all n >= 1, A117966(a(n)) = A083254(n).
Showing 1-7 of 7 results.