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.

A325817 a(n) is the least k >= 0 such that n-k and n-(sigma(n)-k) are relatively prime.

Original entry on oeis.org

0, 0, 0, 0, 0, 5, 0, 0, 0, 1, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 0, 27, 0, 1, 0, 0, 2, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 0, 1, 0, 0, 2, 3, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 2, 1, 0, 1, 2, 1, 0, 1, 2, 5, 0, 0, 2, 0, 0, 1, 0, 1, 2
Offset: 1

Views

Author

Antti Karttunen, May 29 2019

Keywords

Comments

a(n) is the least k >= 0 such that -n + k and (n-sigma(n))+k are coprime.

Examples

			For n=15, gcd(15-0, 15-(24-0)) = 3, gcd(15-1, 15-(24-1)) = 2 and gcd(15-2, 15-(24-2)) = 1, thus a(15) = 2.
		

Crossrefs

Programs

  • Mathematica
    lk[n_]:=Module[{k=0},While[!CoprimeQ[n-k,n-(DivisorSigma[1,n]-k)],k++];k]; Array[lk,110] (* Harvey P. Dale, Nov 24 2024 *)
  • PARI
    A325817(n) = { my(s=sigma(n)); for(k=0, s, if(1==gcd(-n + k, (n-s)+k), return(k))); };
    
  • PARI
    A325817(n) = { my(s=sigma(n)); for(i=0, s, if(1==gcd(n-i, n-(s-i)), return(i))); };

Formula

a(n) = A000203(n) - A325818(n) = A001065(n) - A325826(n) = n - A325976(n).
For all n:
a(A000396(n)) = A000396(n)-1.
a(n) <= n-1.
a(n) <= A325965(n).
a(n) <= A325967(n).