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

A346971 Smallest c which can be split into positive parts a and b with a+b=c, such that the divisors of a,b,c cover all numbers up to n.

Original entry on oeis.org

2, 3, 4, 8, 10, 12, 24, 45, 54, 88, 120, 182, 182, 360, 540, 1326, 1326, 3990, 5040, 5040, 5040, 9282, 9282, 25200, 25200, 65208, 65208, 118800, 118800, 651456, 651456, 651456, 651456, 651456, 651456, 2314200, 2314200, 2314200, 2314200, 16365396, 16365396
Offset: 2

Views

Author

Steven M. Altschuld, Aug 09 2021

Keywords

Comments

a(37)..a(40) <= 2314200 via 1062048 + 1252152 = 2314200. - David A. Corneth, Aug 11 2021

Examples

			a(5) = 8, 3+5=8, divisors of 3, 5, and 8 are {1,3}, {1,5}, and {1,2,4,8}, which covers all of {1,2,3,4,5}.
a(9) = 45, 21+24=45, divisors of 21, 24, and 45 are {1,3,7,21}, {1,2,3,4,6,8,12,24}, and {1,3,5,9,15,45}, which covers all of {1,2,3,4,5,6,7,8,9}.
		

Crossrefs

Programs

  • Mathematica
    a[1]=1;a[n_]:=(k=1;While[Length@Select[Union@*Flatten@*Divisors/@(Join[{k},#]&/@Rest@IntegerPartitions[k,2]),SubsetQ[#,Range@n]&]<1,k++];k);Array[a,16] (* Giorgos Kalogeropoulos, Aug 13 2021 *)
  • Python
    from sympy import divisors
    from itertools import count
    def cond(a, b, c, n):
        return set(divisors(a)+divisors(b)+divisors(c)) >= set(range(1, n+1))
    def a(n):
        if n == 1: return 1
        for c in count(1):
            for a in range(1, c//2+1):
                if cond(a, c-a, c, n): return c
    print([a(n) for n in range(1, 17)]) # Michael S. Branicky, Aug 13 2021
    
  • Python
    def A346971(n):
        c, nlist = 1, list(range(1,n+1))
        while True:
            mlist = [m for m in nlist if c % m]
            if len(mlist) == 0: return c
            p = max(mlist)
            for a in range(p,c,p):
                for m in mlist:
                    if a % m and (c-a) % m:
                        break
                else:
                    return c
            c += 1 # Chai Wah Wu, Oct 13 2021

Formula

a(n) <= A003418(n) and a(n) <= a(n+1). - David A. Corneth, Aug 11 2021
a(n) >= (4*A003418(n))^(1/3). - Charles R Greathouse IV, Oct 14 2021

Extensions

a(16)-a(26) from Alois P. Heinz, Aug 09 2021
a(27)-a(36) from David A. Corneth, Aug 11 2021
a(37)-a(40) from Chai Wah Wu, Oct 13 2021
a(41)-a(42) from Chai Wah Wu, Oct 21 2021

A376926 a(n) is the number of ways n can be written as x + y with x >= y, x and y coprime, and so that the distinct prime factors of x*y*n are consecutive primes starting with 2.

Original entry on oeis.org

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

Views

Author

Zhicheng Wei, Oct 10 2024

Keywords

Examples

			The a(25) = 4 solutions are:
  24 + 1 = 25 and 24 * 1 * 25 = 2^3 * 3 * 5^2;
  21 + 4 = 25 and 21 * 4 * 25 = 2^2 * 3 * 5^2 * 7;
  18 + 7 = 25 and 18 * 7 * 25 = 2 * 3^2 * 5^2 * 7;
  16 + 9 = 25 and 16 * 9 * 25 = 2^4 * 3^2 * 5^2.
The a(27) = 2 solutions are:
  25 + 2 = 27 and 25 * 2 * 27 = 2 * 3^3 * 5^2;
  20 + 7 = 27 and 20 * 7 * 27 = 2^2 * 3^3 * 5 * 7.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local t,x,y,Pn,Px,Py,L;
       t:= 0:
       Pn:= numtheory:-factorset(n);
       for y from 1 to n/2 do
         x:= n-y;
         if igcd(x,y) > 1 then next fi;
         L:= Pn union numtheory:-factorset(x) union numtheory:-factorset(y);
         if max(L) = ithprime(nops(L)) then t:= t+1 fi
      od;
      t
    end proc:
    map(f, [$0..100]); # Robert Israel, Nov 12 2024
  • PARI
    a(n)={sum(k=1, n\2, if(gcd(k,n-k)==1, my(f=factor(k*(n-k)*n)[,1]~); f[#f]==prime(#f)))} \\ Andrew Howroyd, Oct 12 2024
Showing 1-2 of 2 results.