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.

A324400 Lexicographically earliest sequence such that a(i) = a(j) => f(i) = f(j) for all i, j >= 1, where f(n) = -1 if n = 2^k and k > 0, and f(n) = n for all other numbers.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 01 2019

Keywords

Comments

In the following, A stands for this sequence, A324400, and S -> T (where S and T are sequence A-numbers) indicates that for all i, j >= 1: S(i) = S(i) => T(i) = T(j).
For example, the following chains of implications hold:
A -> A286619 -> A005811,
and
A -> A003602 -> A286622 -> A000120,
-> A323889,
-> A000593,
-> A001227,
among many others.

Crossrefs

Programs

  • PARI
    A000523(n) = if(n<1, 0, #binary(n)-1);
    A324400(n) = if(n<4,n,if(!bitand(n,n-1),2,1+n-A000523(n)));

Formula

If n <= 3, a(n) = n; and for n >= 4, if A209229(n) = 1, then a(n) = 2, otherwise a(n) = 1 + n - A000523(n).

A051709 a(n) = sigma(n) + phi(n) - 2n.

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 0, 3, 1, 2, 0, 8, 0, 2, 2, 7, 0, 9, 0, 10, 2, 2, 0, 20, 1, 2, 4, 12, 0, 20, 0, 15, 2, 2, 2, 31, 0, 2, 2, 26, 0, 24, 0, 16, 12, 2, 0, 44, 1, 13, 2, 18, 0, 30, 2, 32, 2, 2, 0, 64, 0, 2, 14, 31, 2, 32, 0, 22, 2, 28, 0, 75, 0, 2, 14, 24, 2, 36, 0
Offset: 1

Views

Author

Keywords

Comments

Sigma is the sum of divisors (A000203), and phi is the Euler totient function (A000010). - Michael B. Porter, Jul 05 2013
Because sigma and phi are multiplicative functions, it is easy to show that (1) if a(n)=0, then n is prime or 1 and (2) if a(n)=2, then n is the product of two distinct prime numbers. Note that a(n) is the n-th term of the Dirichlet series whose generating function is given below. Using the generating function, it is theoretically possible to compute a(n). Hence a(n)=0 could be used as a primality test and a(n)=2 could be used as a test for membership in P2 (A006881). - T. D. Noe, Aug 01 2002
It appears that a(n) - A002033(n) = zeta(s-1) * (zeta(s) - 2 + 1/zeta(s)) + 1/(zeta(s)-2). - Eric Desbiaux, Jul 04 2013
a(n) = 1 if and only if n = prime(k)^2 (n is in A001248). It seems that a(n) = k has only finitely many solutions for k >= 3. - Jianing Song, Jun 27 2021

Examples

			a(5) = sigma(5) + phi(5) - 2*5 = 6 + 4 - 10 = 0.
		

Crossrefs

Cf. A278373 (range of this sequence), A056996 (numbers not present).
Cf. also A344753, A345001 (analogous sequences).

Programs

  • Mathematica
    Table[DivisorSigma[1,n]+EulerPhi[n]-2n,{n,80}] (* Harvey P. Dale, Apr 08 2015 *)
  • PARI
    a(n)=sigma(n)+eulerphi(n)-2*n \\ Charles R Greathouse IV, Jul 05 2013
    
  • PARI
    A051709(n) = -sumdiv(n,d,(dAntti Karttunen, Mar 02 2018

Formula

Dirichlet g.f.: zeta(s-1) * (zeta(s) - 2 + 1/zeta(s)). - T. D. Noe, Aug 01 2002
From Antti Karttunen, Mar 02 2018: (Start)
a(n) = A001065(n) - A051953(n). [Difference between the sum of proper divisors of n and their Moebius-transform.]
a(n) = -Sum_{d|n, dA008683(n/d)*A001065(d). (End)
Sum_{k=1..n} a(k) = (3/(Pi^2) + Pi^2/12 - 1) * n^2 + O(n*log(n)). - Amiram Eldar, Dec 03 2023

A323911 Sum of deficiency of n (A033879) and its Dirichlet inverse.

Original entry on oeis.org

2, 0, 0, 1, 0, 4, 0, 1, 4, 8, 0, -2, 0, 12, 16, 1, 0, -2, 0, 0, 24, 20, 0, -8, 16, 24, 12, 2, 0, -28, 0, 1, 40, 32, 48, -15, 0, 36, 48, -6, 0, -36, 0, 6, 16, 44, 0, -20, 36, 6, 64, 8, 0, -12, 80, -4, 72, 56, 0, -46, 0, 60, 28, 1, 96, -52, 0, 12, 88, -44, 0, -39, 0, 72, 28, 14, 120, -60, 0, -18, 37, 80, 0, -58, 128, 84, 112, 0, 0, -52, 144, 18
Offset: 1

Views

Author

Antti Karttunen, Feb 12 2019

Keywords

Crossrefs

Programs

  • PARI
    up_to = 16384;
    DirInverse(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = -sumdiv(n, d, if(dA033879(n) = (2*n-sigma(n));
    v323910 = DirInverse(vector(up_to,n,A033879(n)));
    A323910(n) = v323910[n];
    A323911(n) = (A033879(n)+A323910(n));

Formula

a(n) = A033879(n) + A323910(n).

A324401 Lexicographically earliest sequence such that a(i) = a(j) => f(i) = f(j) for all i, j >= 1, where f(n) = -1 if n is an odd prime, f(n) = -2 if n = 2^k, with k > 1, and f(n) = n for all other numbers.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 01 2019

Keywords

Comments

For all i, j:
A305801(i) = A305801(j) => a(i) = a(j),
a(i) = a(j) => A305976(i) = A305976(j) => A001221(i) = A001221(j),
a(i) = a(j) => A322591(i) = A322591(j),
a(i) = a(j) => A323235(i) = A323235(j),
a(i) = a(j) => A324399(i) = A324399(j),
a(i) = a(j) => A297159(i) = A297159(j).

Crossrefs

Programs

  • PARI
    A000523(n) = if(n<1, 0, #binary(n)-1);
    A324401(n) = if(n<4,n,if(isprime(n),3,if(!bitand(n,n-1),4,4+n-A000523(n)-primepi(n))));
    
  • 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; };
    Aux324401(n) = if((n>2) && (isprime(n)||!bitand(n,n-1)),-(2-(n%2)),n);
    \\ Equally: Aux324401(n) = if(n<=2,n,if(isprime(n),-1,if(!bitand(n,n-1),-2,n)));
    v324401 = rgs_transform(vector(up_to, n, Aux324401(n)));
    A324401(n) = v324401[n];

Formula

If n <= 2, a(n) = n, for n > 2, if n is an odd prime, a(n) = 3, if n = 2^k, with k >= 2, a(n) = 4, otherwise a(n) = 4 + n - A000523(n) - A000720(n).

A323904 Lexicographically earliest sequence such that a(i) = a(j) => A033879(i) = A033879(j) and A083254(i) = A083254(j), for all i, j >= 1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 10 2019

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A033879(n), A083254(n)], the deficiency of n, and its Möbius transform.
For all i, j: a(i) = a(j) => A297159(i) = A297159(j).

Examples

			For n=39, we have A033879(39) = 2*39 - A000203(39) = 22, and A083254(39) = 2*A000010(39)-39 = 9. For n=63 the results are same, with A033879(63) = 22 and A083254(63) = 9, thus a(39) and a(63) are allotted the same number by the restricted growth sequence transform, which in this case is 35, thus a(39) = a(63) = 35.
For n=42 and 54, we have A033879(42) = -12, A083254(42) = -18 and A033879(54) = -12, A083254(54) = -18, thus a(42) = a(54) (= 38).
		

Crossrefs

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; };
    A033879(n) = (2*n-sigma(n));
    A083254(n) = (2*eulerphi(n)-n);
    A323904aux(n) = [A033879(n), A083254(n)];
    v323904 = rgs_transform(vector(up_to,n,A323904aux(n)));
    A323904(n) = v323904[n];

Formula

a(2^n) = 2 for all n >= 1.

A324048 a(n) = A000203(n) - A083254(n) = n + sigma(n) - 2*phi(n).

Original entry on oeis.org

0, 3, 3, 7, 3, 14, 3, 15, 10, 20, 3, 32, 3, 26, 23, 31, 3, 45, 3, 46, 29, 38, 3, 68, 16, 44, 31, 60, 3, 86, 3, 63, 41, 56, 35, 103, 3, 62, 47, 98, 3, 114, 3, 88, 75, 74, 3, 140, 22, 103, 59, 102, 3, 138, 47, 128, 65, 92, 3, 196, 3, 98, 95, 127, 53, 170, 3, 130, 77, 166, 3, 219, 3, 116, 119, 144, 53, 198, 3, 202, 94, 128, 3
Offset: 1

Views

Author

Antti Karttunen, Feb 13 2019

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := n + DivisorSigma[1, n] - 2 * EulerPhi[n]; Array[a, 100] (* Amiram Eldar, Dec 04 2023 *)
  • PARI
    A083254(n) = (2*eulerphi(n)-n);
    A324048(n) = (sigma(n) - A083254(n));
    
  • PARI
    a(n) = {my(f = factor(n)); n + sigma(f) - 2*eulerphi(f);} \\ Amiram Eldar, Dec 04 2023

Formula

a(n) = A000203(n) - A083254(n) = n + A000203(n) - 2*A000010(n).
a(n) = A051612(n) + A051953(n).
a(n) = A297159(n) + 2*A001065(n).
Sum_{k=1..n} a(k) = (Pi^2/12 - 6/Pi^2 + 1/2) * n^2 + O(n*log(n)). - Amiram Eldar, Dec 04 2023
Showing 1-6 of 6 results.