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

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

A278373 Numbers of the form sigma(k) + phi(k) - 2k.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 20, 22, 24, 25, 26, 28, 29, 30, 31, 32, 34, 36, 37, 38, 40, 41, 42, 44, 46, 48, 49, 50, 52, 54, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 68, 70, 72, 73, 74, 75, 76, 77, 78, 80, 82, 84, 85, 86, 88, 89, 90, 91, 92, 93, 94, 96, 97, 98, 100, 102, 104, 106, 108, 109, 110, 111, 112, 114
Offset: 1

Views

Author

David W. Wilson, Nov 19 2016

Keywords

Comments

Empirically, every integer n >= 18 is of the form n = p+q+r for distinct primes p,q,r. If true, then every even number e >= 36 is this sequence, since e = 2(p+q+r) = sigma(pqr) + phi(pqr) - 2pqr, which implies all even e >= 0 are in this sequence.

Crossrefs

Smallest k with sigma(k) + phi(k) - 2k = a(n) is A278374(n).
Complement is A056996.
Sequence A051709 sorted into ascending order, with duplicates removed.- Antti Karttunen, Dec 09 2016
Cf. A000010 (phi), A000203 (sigma).

Programs

  • Mathematica
    Take[#, 85] &@ Union@ Table[DivisorSigma[1, n] + EulerPhi@ n - 2 n, {n, 10^4}] (* Michael De Vlieger, Nov 30 2016 *)

A278922 Largest p such that n = p + q + r where p < q < r are all prime, or 0 if no such primes p, q, r exist.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 2, 3, 2, 0, 2, 3, 2, 3, 2, 5, 2, 5, 2, 3, 2, 5, 2, 7, 2, 5, 2, 7, 2, 7, 2, 7, 2, 11, 2, 11, 2, 5, 2, 11, 2, 13, 2, 11, 2, 13, 2, 13, 2, 11, 2, 17, 2, 13, 2, 13, 2, 17, 2, 17, 2, 17, 2, 19, 2, 19, 2, 13, 2, 17, 2, 19, 2, 17, 2, 23, 2, 19, 2, 19, 2, 23, 2, 23, 2, 23, 2, 23, 2, 29, 2, 23, 2, 29, 2, 29, 2, 23, 2, 29, 2, 31, 2, 31, 2, 29, 2, 31, 2, 29, 2, 31, 2, 37
Offset: 1

Views

Author

M. F. Hasler, Dec 01 2016

Keywords

Comments

Empirically, a(n) >= 2 for all n >= 18. Since a(2n) = 2 unless it is zero, the terms with even indices are less interesting, and the terms with odd indices are listed in A278923.
For even n, the existence of the three primes reduces to a slightly strengthened* variant of Goldbach's conjecture. For odd n, is a slightly strengthened* variant of the weak (a.k.a. odd, or ternary) Goldbach conjecture, considered to be proved since 2013. (*) In both cases, the strengthening consists of requiring that the three primes must be distinct.
From Robert G. Wilson v, Dec 02 2016: (Start)
The first occurrence of the n-th prime: 10, 15, 23, 31, 41, 49, 59, 71, 83, 97, 109, 121, 131, 143, 159, 173, 187, 199, 211, 223, 235, 251, 269, 287, 301, 311, 319, 329, 349, 371, 395, 407, 425, 439, 457, 471, 487, 503, ..., .
Conjecture: primes appear in their natural order. (End)

Crossrefs

Cf. A278923.
Cf. A278373, complement of A056996.

Programs

  • Mathematica
    f[n_] := If[OddQ@n || n < 18, Block[{p = 0, q = 3, r = 5}, While[q < r, r = NextPrime@ q; While[r < n - q - 1, If[n < 2q + r && PrimeQ[n - r - q], p = Max[p, n - r - q]; Break[]]; r = NextPrime@ r]; q = NextPrime@ q]; p], 2]; Array[f, 121] (* Robert G. Wilson v, Dec 02 2016 *)
  • PARI
    a(n,p=if(bittest(n,0),n\3-1,3))=while(p=precprime(p-1),forprime(q=p+1,(n-p-1)\2,isprime(n-p-q)&&return(p)))

Formula

a(2n) = 2 (for n > 4), since one of the three primes must necessarily be even, and that can only be p = 2.
a(n) = 0 for n < 2 + 3 + 5 = 10, and for odd n < 3 + 5 + 7 = 15.

A278923 Largest p such that 2n-1 = p + q + r with three primes p < q < r, or 0 if no such primes exist.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 3, 0, 3, 3, 5, 5, 3, 5, 7, 5, 7, 7, 7, 11, 11, 5, 11, 13, 11, 13, 13, 11, 17, 13, 13, 17, 17, 17, 19, 19, 13, 17, 19, 17, 23, 19, 19, 23, 23, 23, 23, 29, 23, 29, 29, 23, 29, 31, 31, 29, 31, 29, 31, 37, 29, 37, 37, 31, 41, 37, 31, 41, 37, 41, 43, 41, 41, 43, 43, 41, 43, 43, 47, 47, 43, 41, 47, 43, 47, 53, 47, 47, 53, 53, 53, 53, 59, 47
Offset: 1

Views

Author

M. F. Hasler, Dec 01 2016

Keywords

Comments

Empirically, such primes always exist for n >= 10, i.e., 2n-1 >= 19, whence a(n) >= 3 for all n >= 10. Again empirically, a(n) ~ 2n/3 as n -> oo and a(n) is always close to 2n/3.
This is the bisection (every other term) of A278922, whose terms with even indices are all equal to 2 (or 0).

Crossrefs

Cf. A278922.
Cf. A278373, complement of A056996.

Programs

  • PARI
    a(n,p=(n=2*n-1)\3-1)=while(p=precprime(p-1),forprime(q=p+1,(n-p-1)\2,isprime(n-p-q)&&return(p)))
Showing 1-4 of 4 results.