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.

A381071 Numbers k such that the sum of the proper divisors of k that have the same binary weight as k is larger than k, and no subset of these divisors sums to k.

This page as a plain text file.
%I A381071 #7 Feb 17 2025 03:28:55
%S A381071 1050,3150,4284,4410,5148,6292,6790,7176,8890,10764,17850,18648,19000,
%T A381071 19530,32886,33072,33150,35088,35530,35720,35770,38850,41360,43164,
%U A381071 45084,49368,49764,50456,50730,52884,54280,54340,58410,58696,59010,59408,63492,66010,68376
%N A381071 Numbers k such that the sum of the proper divisors of k that have the same binary weight as k is larger than k, and no subset of these divisors sums to k.
%C A381071 Analogous to weird numbers (A006037), as A380846 is analogous to perfect numbers (A000396).
%H A381071 Amiram Eldar, <a href="/A381071/b381071.txt">Table of n, a(n) for n = 1..1724</a>
%t A381071 divs[n_] := Module[{hw = DigitCount[n, 2, 1]}, Select[Divisors[n], DigitCount[#, 2, 1] == hw &]];
%t A381071 weirdQ[n_, d_, s1_, m1_] :=  weirdQ[n, d, s1, m1] = Module[{s = s1, m = m1}, If[m == 0, False, While[m > 0 && d[[m]] > n, s -= d[[m]]; m--]; If[m == 0, True, d[[m]] < n && If[s > n, weirdQ[n - d[[m]], d, s - d[[m]], m - 1] && weirdQ[n, d, s - d[[m]], m - 1], s < n && m < Length[d] - 1]]]];
%t A381071 q[n_] := Module[{d = divs[n], s, m}, s = Total[d] - n; m = Length[d] - 1; weirdQ[n, d, s, m]]; Select[Range[70000], q] (* based on a Pari code by _M. F. Hasler_ at A006037 *)
%o A381071 (PARI) divs(n) = {my(h = hammingweight(n)); select(x -> hammingweight(x)==h, divisors(n));}
%o A381071 is(n, d = divs(n), s = vecsum(d)-n, m = #d-1) = {if(m == 0, return(0)); while(m > 0 && d[m] > n, s -= d[m]; m--); if(m==0, return(1)); (d[m] < n &&
%o A381071 if(s > n, is(n-d[m], d, s-d[m], m-1) && is(n, d, s-d[m], m-1), s < n && m < #d-1));} \\ based on a code by _M. F. Hasler_ at A006037
%Y A381071 Cf. A000396, A380845, A380846.
%Y A381071 Subsequence of A380929.
%Y A381071 A381072 is a subsequence.
%Y A381071 Similar sequences: A006037, A064114, A292986, A306984, A321146, A327948, A339939, A348525, A348631, A349285, A364862.
%K A381071 nonn,base
%O A381071 1,1
%A A381071 _Amiram Eldar_, Feb 13 2025