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

A324213 Number of k with 0 <= k <= sigma(n) such that n-k and 2n-sigma(n) are relatively prime.

Original entry on oeis.org

2, 4, 3, 8, 4, 2, 4, 16, 12, 9, 6, 14, 6, 12, 8, 32, 10, 26, 8, 21, 14, 18, 12, 20, 30, 16, 18, 2, 14, 24, 10, 64, 16, 24, 22, 88, 14, 30, 26, 36, 18, 32, 14, 42, 26, 28, 24, 54, 56, 80, 20, 32, 26, 40, 36, 60, 38, 42, 30, 56, 18, 42, 48, 128, 42, 48, 22, 50, 28, 72, 26, 122, 26, 54, 58, 46, 48, 56, 26, 86, 120, 60, 42, 96, 54
Offset: 1

Views

Author

Antti Karttunen and David A. Corneth, May 26 2019, with better name from Charlie Neder, Jun 02 2019

Keywords

Comments

Number of ways to form the sum sigma(n) = x+y so that n-x and n-y are coprime, with x and y in range 0..sigma(n).
From Antti Karttunen, May 28 - Jun 08 2019: (Start)
Empirically, it seems that a(n) >= A034444(n) and also that a(n) >= A034444(A000203(n)) unless n is in A000396.
Specifically, if it could be proved that a(n) >= A034444(n)/2 for n >= 2, which in turn would imply that a(n) >= A001221(n) for all n, then we would know that no odd perfect numbers could exist. Note that a(n) must be 2 on all perfect numbers, whether even or odd. See also A325819.
(End)

Examples

			For n=1, sigma(1) = 1, both gcd(1-0, 1-(1-0)) = gcd(1,0) = 1 and gcd(1-1, 1-(1-1)) = gcd(0,1) = 1, thus a(1) = 2.
--
For n=3, sigma(3) = 4, we have 5 cases to consider:
  gcd(3-0, 3-(4-0)) = 1 = gcd(3-4, 3-(4-4)),
  gcd(3-1, 3-(4-1)) = 2 = gcd(3-3, 3-(4-3)),
  gcd(3-2, 3-(4-2)) = 1,
of which three cases give 1 as a result, thus a(3) = 3.
--
For n=6, sigma(6) = 12, we have 13 cases to consider:
  gcd(6-0, 6-(12-0)) = 6 = gcd(6-12, 6-(12-12)),
  gcd(6-1, 6-(12-1)) = 5 = gcd(6-11, 6-(12-11)),
  gcd(6-2, 6-(12-2)) = 4 = gcd(6-10, 6-(12-10)),
  gcd(6-3, 6-(12-3)) = 3 = gcd(6-9, 6-(12-9)),
  gcd(6-4, 6-(12-4)) = 2 = gcd(6-8, 6-(12-8))
  gcd(6-5, 6-(12-5)) = 1 = gcd(6-7, 6-(12-7)),
  gcd(6-6, 6-(12-6)) = 0,
of which only two give 1 as a result, thus a(6) = 2.
--
For n=10, sigma(10) = 18, we have 19 cases to consider:
  gcd(10-0, 10-(18-0)) = 2 = gcd(10-18, 10-(18-18)),
  gcd(10-1, 10-(18-1)) = 1 = gcd(10-17, 10-(18-17)),
  gcd(10-2, 10-(18-2)) = 2 = gcd(10-16, 10-(18-16)),
  gcd(10-3, 10-(18-3)) = 1 = gcd(10-15, 10-(18-15)),
  gcd(10-4, 10-(18-4)) = 2 = gcd(10-14, 10-(18-14)),
  gcd(10-5, 10-(18-5)) = 1 = gcd(10-13, 10-(18-13)),
  gcd(10-6, 10-(18-6)) = 2 = gcd(10-12, 10-(18-12)),
  gcd(10-7, 10-(18-7)) = 1 = gcd(10-11, 10-(18-11)),
  gcd(10-8, 10-(18-8)) = 2 = gcd(10-10, 10-(18-10)),
  gcd(10-9, 10-(18-9)) = 1,
of which 9 cases give 1 as a result, thus a(10) = 9.
--
For n=15, sigma(15) = 24, we have 25 cases to consider:
  gcd(15-0, 15-(24-0)) = 3 = gcd(15-24, 15-(24-24)),
  gcd(15-1, 15-(24-1)) = 2 = gcd(15-23, 15-(24-23)),
  gcd(15-2, 15-(24-2)) = 1 = gcd(15-22, 15-(24-22)),
  gcd(15-3, 15-(24-3)) = 6 = gcd(15-21, 15-(24-21)),
  gcd(15-4, 15-(24-4)) = 1 = gcd(15-20, 15-(24-20)),
  gcd(15-5, 15-(24-5)) = 2 = gcd(15-19, 15-(24-19)),
  gcd(15-6, 15-(24-6)) = 3 = gcd(15-18, 15-(24-18)),
  gcd(15-7, 15-(24-7)) = 2 = gcd(15-17, 15-(24-17)),
  gcd(15-8, 15-(24-8)) = 1 = gcd(15-16, 15-(24-16)),
  gcd(15-9, 15-(24-9)) = 6 = gcd(15-15, 15-(24-15)),
  gcd(15-10, 15-(24-10)) = 1 = gcd(15-14, 15-(24-14)),
  gcd(15-11, 15-(24-11)) = 2 = gcd(15-13, 15-(24-13)),
  gcd(15-12, 15-(24-12)) = 3,
of which 2*4 = 8 cases give 1 as a result, thus a(15) = 8.
		

Crossrefs

Programs

  • Mathematica
    Array[Sum[Boole[1 == GCD[#1 - i, #1 - (#2 - i)]], {i, 0, #2}] & @@ {#, DivisorSigma[1, #]} &, 85] (* Michael De Vlieger, Jun 09 2019 *)
  • PARI
    A324213(n) = { my(s=sigma(n)); sum(i=0,s,(1==gcd(n-i,n-(s-i)))); };

Formula

a(n) = Sum_{i=0..sigma(n)} [1 == gcd(n-i,n-(sigma(n)-i))], where [ ] is the Iverson bracket and sigma(n) is A000203(n).
a(A000396(n)) = 2.
a(n) = A325815(n) + A034444(n).
a(n) = 1+A000203(n) - A325816(n).
a(A228058(n)) = A325819(n).

A325818 a(n) is the largest k <= sigma(n) such that n-k and n-(sigma(n)-k) are relatively prime.

Original entry on oeis.org

1, 3, 4, 7, 6, 7, 8, 15, 13, 17, 12, 27, 14, 23, 22, 31, 18, 38, 20, 41, 32, 35, 24, 59, 31, 39, 40, 29, 30, 71, 32, 63, 46, 53, 48, 91, 38, 59, 56, 89, 42, 95, 44, 83, 76, 69, 48, 123, 57, 93, 70, 95, 54, 119, 72, 119, 80, 89, 60, 167, 62, 95, 104, 127, 84, 143, 68, 125, 94, 143, 72, 194, 74, 113, 124, 137, 96
Offset: 1

Views

Author

Antti Karttunen, May 29 2019

Keywords

Comments

a(n) is the largest k <= sigma(n) such that (-n + k) and (n-sigma(n))+k are coprime.

Crossrefs

Programs

  • PARI
    A325818(n) = { my(s=sigma(n)); for(i=0, s, if(1==gcd(n-i, n-(s-i)), return(s-i))); };

Formula

a(n) = A000203(n) - A325817(n).
a(n) = n + A325826(n).
For all n:
a(A000396(n)) = A000396(n)+1.
a(n) >= A325961(n).
a(n) >= A325966(n).
a(n) >= A325968(n).

A325826 a(n) is the largest k <= sigma(n)-n such that k and (2n-sigma(n)) [= A033879(n)] are relatively prime.

Original entry on oeis.org

0, 1, 1, 3, 1, 1, 1, 7, 4, 7, 1, 15, 1, 9, 7, 15, 1, 20, 1, 21, 11, 13, 1, 35, 6, 13, 13, 1, 1, 41, 1, 31, 13, 19, 13, 55, 1, 21, 17, 49, 1, 53, 1, 39, 31, 23, 1, 75, 8, 43, 19, 43, 1, 65, 17, 63, 23, 31, 1, 107, 1, 33, 41, 63, 19, 77, 1, 57, 25, 73, 1, 122, 1, 39, 49, 61, 19, 89, 1, 105, 40, 43, 1, 139, 23, 43, 31, 91, 1, 143, 19, 75
Offset: 1

Views

Author

Antti Karttunen, May 29 2019

Keywords

Crossrefs

Programs

  • PARI
    A325826(n) = { my(s=sigma(n)); forstep(k=s-n, 0, -1, if(1==gcd((n+n-sigma(n)), k), return(k))); };
    
  • PARI
    A325818(n) = { my(s=sigma(n)); for(i=0, s, if(1==gcd(n-i, n-(s-i)), return(s-i))); };
    A325826(n) = (A325818(n) - n);

Formula

a(n) = A325818(n) - n = A001065(n) - A325817(n) = A325976(n) - A033879(n).
a(A000040(n)) = a(A000396(n)) = 1.
a(n) >= A325969(n).
gcd(a(n), A325976(n)) = 1.

A325961 a(n) is the least k >= A061228(n)-1 such that n-k and n-(sigma(n)-k) are relatively prime, or 0 if no such k <= sigma(n) exists.

Original entry on oeis.org

1, 3, 0, 5, 0, 7, 0, 9, 11, 11, 0, 13, 0, 15, 20, 17, 0, 19, 0, 21, 24, 23, 0, 25, 29, 27, 30, 29, 0, 31, 0, 33, 38, 35, 40, 37, 0, 39, 42, 41, 0, 43, 0, 45, 50, 47, 0, 49, 55, 51, 58, 53, 0, 55, 60, 57, 60, 59, 0, 61, 0, 63, 66, 65, 70, 67, 0, 69, 74, 71, 0, 73, 0, 75, 78, 77, 84, 79, 0, 81, 83, 83, 0, 85, 90, 87, 92, 89, 0, 91, 100
Offset: 1

Views

Author

Antti Karttunen, May 29 2019

Keywords

Comments

a(n) attains the value of A325818(n) only with n = 1, 2 and the even terms of A000396. Note that A000203(n) > ((n+A020639(n))-1) with composite n.

Crossrefs

Programs

  • PARI
    A020639(n) = if(1==n, n, factor(n)[1, 1]);
    A325961(n) = { my(s=sigma(n)); for(i=(-1)+n+A020639(n), s, if(1==gcd(n-i, n-(s-i)), return(i))); (0); };

Formula

a(n) = 0 if and only if n is either an odd prime or an odd perfect number, but if n is neither, then a(n) = 2n - A325962(n).

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

Original entry on oeis.org

1, 2, 4, 2, 6, 5, 8, 2, 3, 3, 12, 3, 14, 3, 4, 2, 18, 2, 20, 3, 4, 3, 24, 5, 5, 3, 4, 27, 30, 5, 32, 2, 4, 3, 6, 2, 38, 3, 4, 3, 42, 5, 44, 3, 4, 3, 48, 3, 7, 2, 4, 3, 54, 5, 6, 3, 4, 3, 60, 5, 62, 3, 4, 2, 6, 5, 68, 5, 4, 3, 72, 2, 74, 3, 4, 3, 8, 5, 80, 3, 3, 3, 84, 3, 6, 3, 4, 3, 90, 5, 8, 3, 4, 3, 6, 5, 98, 2, 4, 2
Offset: 1

Views

Author

Antti Karttunen, May 29 2019

Keywords

Crossrefs

Programs

  • PARI
    A020639(n) = if(1==n, n, factor(n)[1, 1]);
    A325965(n) = { my(s=sigma(n)); for(i=A020639(n), s, if(1==gcd(n-i, n-(s-i)), return(i))); };

Formula

a(n) = A000203(n) - A325966(n).
For all n:
a(A000396(n)) = A000396(n)-1.
a(n) >= A325817(n).

A325962 a(1) = 1; for n > 1, a(n) is the largest k <= 1+A046666(n) such that n-k and n-(sigma(n)-k) are relatively prime, or -1 if no such nonnegative k exists.

Original entry on oeis.org

1, 1, 0, 3, 0, 5, 0, 7, 7, 9, 0, 11, 0, 13, 10, 15, 0, 17, 0, 19, 18, 21, 0, 23, 21, 25, 24, 27, 0, 29, 0, 31, 28, 33, 30, 35, 0, 37, 36, 39, 0, 41, 0, 43, 40, 45, 0, 47, 43, 49, 44, 51, 0, 53, 50, 55, 54, 57, 0, 59, 0, 61, 60, 63, 60, 65, 0, 67, 64, 69, 0, 71, 0, 73, 72, 75, 70, 77, 0, 79, 79, 81, 0, 83, 80, 85, 82, 87, 0, 89, 82
Offset: 1

Views

Author

Antti Karttunen, May 29 2019

Keywords

Comments

a(n) is equal to A325817(n) only with odd primes and the even terms of A000396. a(n) = -1 only on odd perfect numbers, if such numbers exist. Otherwise a(n) = 2n - A325961(n).

Crossrefs

Programs

  • PARI
    A020639(n) = if(1==n, n, factor(n)[1, 1]);
    A325962(n) = { my(s=sigma(n)); forstep(i=1+n-A020639(n), 0, -1, if(1==gcd(n-i, n-(s-i)), return(i))); (-1); };

Formula

For all n, a(A065091(n)) = 0.

A325967 a(n) is the minimum sum of all such subsets of divisors of n for which n-s and (sigma(n)-s)-n are relatively prime, where s is the sum of the subset.

Original entry on oeis.org

0, 0, 0, 0, 0, 5, 0, 0, 0, 1, 0, 1, 0, 1, 4, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 0, 27, 0, 1, 0, 0, 4, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 4, 3, 0, 1, 0, 0, 4, 3, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 4, 1, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 4, 1, 0, 1, 8, 1, 0, 1, 6, 5, 0, 0, 4, 0, 0, 1, 0, 1, 4
Offset: 1

Views

Author

Antti Karttunen, May 29 2019

Keywords

Comments

Partition the divisors of n in all possible ways into such complementary subsets x and y for which gcd(n-Sum(x), n-Sum(y)) = 1. a(n) is the minimal value of min(Sum(x), Sum(y)) attained over all such pairs of subsets x and y.
Records 0, 5, 27, 495, 8127, 8289, 10359, 11049, 13809, 15189, 15879, ... occur at 1, 6, 28, 496, 8128, 33148, 41428, 44188, 55228, 60748, 63508, ...
Equivalently, the least k expressible as a sum of distinct divisors of n such that gcd(n-k,A033879(n)) = 1, with the convention that gcd(k,0) = k. - Charlie Neder, Jun 09 2019

Examples

			For n=15, its divisors are [1, 3, 5, 15]. If we take an empty set [] and its complement [1, 3, 5, 15], their sums are 0 and 24, but gcd(15-0, 24-15) = gcd(15, 9) = 3 > 1. If we take subsets [1] and [3, 5, 15], then their sums are 1 and 23, but gcd(15-1, 23-15) = gcd(14,8) = 2 > 1. If we take subsets [3] and [1, 5, 15], their sums are 3 and 21, but gcd(15-3, 21-15) = gcd(12, 6) = 6 > 1. Only when we take the subset with a next larger sum, [1, 3] and its complement [5, 15], we get such sums 4 and 20 for which gcd(15-4, 20-15) = gcd(11, 5) = 1. Thus a(15) = 4, the size of the subset with lesser sum.
		

Crossrefs

Cf. A000203, A000396, A009194, A014567 (positions of zeros), A325807, A325817, A325968, A325969.

Programs

  • PARI
    \\ Probably not the most optimal algorithm, but at least faster than the implementation using sumbybits (below):
    A325967aux(n, ds, s, ms, divs, from=1) = if(1==gcd((s-ds)-n,n-ds), return(ds), for(i=from, #divs, if(ds+divs[i] >= ms, return(ms), ms = min(ms,A325967aux(n, ds+divs[i], s, ms, divs, i+1)))); (ms));
    A325967(n) = if(1==gcd(n, sigma(n)), 0, my(divs = List(divisors(n)), s=sigma(n), ms=2*s); fordiv(n,d, if(d>=ms, return(ms), listpop(divs,1); ms = min(ms,A325967aux(n, d, s, ms, divs)))); (ms));
    
  • PARI
    A325967(n) = { my(divs=divisors(n), s=sigma(n),r,ms=-1); for(b=0,(2^(length(divs)))-1,r=sumbybits(divs,b);if(1==gcd(n-(s-r),n-r),if(ms<0||r0,s += (b%2)*v[i]; i++; b >>= 1); (s); };

Formula

a(n) = A000203(n) - A325968(n) = A001065(n) - A325969(n).
For all n, a(A000396(n)) = A000396(n)-1.
For all n, a(n) >= A325817(n).

A325960 a(n) is k-n for the least k >= n+(A020639(n)-1) such that n-k and n-(sigma(n)-k) are relatively prime, or 0 if no such k <= sigma(n) exists.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 5, 1, 0, 1, 0, 1, 3, 1, 0, 1, 4, 1, 3, 1, 0, 1, 0, 1, 5, 1, 5, 1, 0, 1, 3, 1, 0, 1, 0, 1, 5, 1, 0, 1, 6, 1, 7, 1, 0, 1, 5, 1, 3, 1, 0, 1, 0, 1, 3, 1, 5, 1, 0, 1, 5, 1, 0, 1, 0, 1, 3, 1, 7, 1, 0, 1, 2, 1, 0, 1, 5, 1, 5, 1, 0, 1, 9, 1, 3, 1, 9, 1, 0, 1, 5, 1, 0, 1, 0, 1, 5
Offset: 1

Views

Author

Antti Karttunen, May 29 2019

Keywords

Comments

By definition, if n is neither an odd prime nor an odd perfect number, then a(n) >= (A020639(n)-1).

Crossrefs

Cf. A006005 (positions of zeros, provided no odd perfect numbers exist).

Programs

  • PARI
    A020639(n) = if(1==n, n, factor(n)[1, 1]);
    A325960(n) = { my(s=sigma(n)); for(i=(-1)+n+A020639(n), s, if(1==gcd(n-i, n-(s-i)), return(i-n))); (0); };

Formula

a(n) = (A325961(n) - A325962(n)) / 2, assuming no odd perfect numbers exist.
a(2n) = 1.

A325976 a(n) is the largest k <= n such that k and (2n-sigma(n)) [= A033879(n)] are relatively prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 1, 7, 8, 9, 9, 11, 11, 13, 13, 13, 16, 17, 17, 19, 19, 21, 21, 23, 23, 25, 23, 27, 1, 29, 29, 31, 32, 31, 33, 35, 36, 37, 37, 39, 39, 41, 41, 43, 43, 43, 43, 47, 47, 49, 50, 49, 49, 53, 53, 55, 55, 57, 57, 59, 59, 61, 61, 63, 64, 65, 65, 67, 67, 67, 69, 71, 71, 73, 73, 75, 73, 77, 77, 79, 79, 81, 81, 83, 83, 85, 83
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2019

Keywords

Crossrefs

Programs

  • PARI
    A325976(n) = { my(s=sigma(n)); forstep(k=n, 0, -1, if(1==gcd((n+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))); };
    A325976(n) = (n - A325817(n));

Formula

a(n) = n - A325817(n) = A033879(n) + A325826(n).
a(n) >= A325959(n).
gcd(a(n), A325826(n)) = 1.

A325971 a(n) is the least k >= A007947(n) such that -n + k and (n-sigma(n))+k are relatively prime.

Original entry on oeis.org

1, 2, 4, 2, 6, 7, 8, 2, 3, 11, 12, 7, 14, 15, 16, 2, 18, 7, 20, 11, 22, 23, 24, 7, 5, 27, 4, 27, 30, 31, 32, 2, 34, 35, 36, 6, 38, 39, 40, 11, 42, 43, 44, 23, 16, 47, 48, 7, 7, 10, 52, 27, 54, 7, 56, 15, 58, 59, 60, 31, 62, 63, 22, 2, 66, 67, 68, 35, 70, 71, 72, 7, 74, 75, 16, 39, 78, 79, 80, 11, 3, 83, 84, 43, 86, 87, 88, 23, 90, 31
Offset: 1

Views

Author

Antti Karttunen, May 31 2019

Keywords

Comments

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

Crossrefs

Programs

  • PARI
    A007947(n) = factorback(factorint(n)[, 1]); \\ From A007947
    A325971(n) = { my(s=sigma(n)); for(i=A007947(n), s, if(1==gcd(n-i, n-(s-i)), return(i))); (0); };
    A325971(n) = { my(s=sigma(n)); for(k=A007947(n), s, if(1==gcd(-n + k, (n-sigma(n))+k), return(k))); };

Formula

a(n) = A000203(n) - A325972(n).
a(n) = n - A325970(n).
Showing 1-10 of 10 results.