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.

A246198 Half-Zumkeller numbers: numbers n whose proper positive divisors can be partitioned into two disjoint sets whose sums are equal.

Original entry on oeis.org

6, 12, 20, 24, 28, 30, 40, 42, 48, 54, 56, 60, 66, 70, 78, 80, 84, 88, 90, 96, 102, 104, 108, 112, 114, 120, 126, 132, 138, 140, 150, 156, 160, 168, 174, 176, 180, 186, 192, 198, 204, 208, 210, 216, 220, 222, 224, 225, 228, 234, 240, 246, 252, 258, 260, 264
Offset: 1

Views

Author

Chai Wah Wu, Aug 18 2014

Keywords

Comments

All even half-Zumkeller numbers are in A083207, i.e. they are Zumkeller numbers (see Clark et al. 2008). The first 47 terms coincide with A083207. 225 is the first number in the sequence that is not a Zumkeller number.

Examples

			Proper divisors of 225 are 1, 3, 5, 9, 15, 25, 45, 75 and 1+3+15+25+45=5+9+75.
		

References

  • S. Clark et al., Zumkeller numbers, Mathematical Abundance Conference, April 2008.

Crossrefs

Cf. A083207.

Programs

  • Maple
    filter:= proc(n) local L,s,t,nL,B,j,k;
       L:= numtheory:-divisors(n) minus {n};
       s:= convert(L,`+`);
       if s::odd then return false fi;
       t:= s/2;
       nL:= nops(L);
       B:= Array(0..t,1..nL);
       B[0,1]:= 1;
       B[L[1],1]:= 1;
       for j from 2 to nL do
          B[..,j]:= B[..,j-1];
          for k from L[j] to t do
             B[k,j]:= B[k,j] + B[k-L[j],j-1]
          od:
          if B[t,j] > 0 then return true fi;
       od:
       false
    end:
    select(filter, [$2..300]); # Robert Israel, Aug 19 2014
  • Mathematica
    filterQ[n_] := Module[{L, s, t, nL, B, j, k},
      L = Most[Divisors[n]];
      s = Total[L];
      If[OddQ[s], Return[False]];
      t = s/2;
      nL = Length[L];
      B[, ] = 0;
      B[0, 1] = 1;
      B[L[[1]], 1] = 1;
      For[j = 2, j <= nL, j++,
        Do[B[k, j] = B[k, j-1], {k, 0, t}];
        For[k = L[[j]], k <= t, k++,
          B[k, j] = B[k, j] + B[k-L[[j]], j-1]
        ];
        If[ B[t, j] > 0, Return[True]];
      ];
      False
    ];
    Select[Range[2, 300], filterQ] (* Jean-François Alcover, Mar 04 2019, after Robert Israel *)
    hzQ[n_] := Module[{d = Most @ Divisors[n], sum, x}, sum = Plus @@ d; EvenQ[sum] && CoefficientList[Product[1 + x^i, {i, d}], x][[1 + sum/2]] > 0]; Select[Range[2, 1000], hzQ] (* Amiram Eldar, May 03 2020 *)
  • Python
    from sympy.combinatorics.subsets import Subset
    from sympy import divisors
    A246198 = []
    for n in range(2,10**3):
        d = divisors(n)
        d.remove(n)
        s, dmax = sum(d), max(d)
        if not s % 2 and 2*dmax <= s:
            d.remove(dmax)
            s2 = s/2-dmax
            for x in range(2**len(d)):
                if sum(Subset.unrank_binary(x,d).subset) == s2:
                    A246198.append(n)
                    break
    
  • Python
    from sympy import divisors
    import numpy as np
    A246198 = []
    for n in range(2, 10**3):
        d = divisors(n)
        d.remove(n)
        s, dmax = sum(d), max(d)
        if not s % 2 and 2*dmax <= s:
            d.remove(dmax)
            s2, ld = int(s/2-dmax), len(d)
            z = np.zeros((ld+1, s2+1), dtype=int)
            for i in range(1, ld+1):
                y = min(d[i-1], s2+1)
                z[i, range(y)] = z[i-1, range(y)]
                z[i, range(y, s2+1)] = np.maximum(z[i-1, range(y, s2+1)], z[i-1, range(0, s2+1-y)]+y)
                if z[i, s2] == s2:
                    A246198.append(n)
                    break
    # Chai Wah Wu, Aug 19 2014