login
a(n) is the least A000120-perfect number (A175522) whose binary weight (A000120) is n, or 0 if no such number exists.
0

%I #9 Jan 25 2024 12:35:15

%S 2,0,25,169,841,95,247,943,767,5999,6139,16123,30655,90109,122847,

%T 245695,522237,1572591,1966015,3932095,12582651,28311519,33423343,

%U 100663023,133693435,402128831,931135479,1069547515,1610612607,11802771447,12884901567,25736249279

%N a(n) is the least A000120-perfect number (A175522) whose binary weight (A000120) is n, or 0 if no such number exists.

%C Apparently, the sequence is increasing after n = 6.

%e a(1) = 2 since A000120(2) = 1 and A093653(2)/A000120(2) = 4/2 = 2.

%e a(2) = 0 since there is no number m with binary weight 2 and with A093653(m) = 4.

%e a(3) = 25 since A000120(25) = 3 and A093653(25)/A000120(25) = 6/3 = 2, and 25 is the least number with this property.

%t seq[len_, nmax_] := Module[{s = Table[-1, {len}], n = 3, c = 2, bw, dbw}, s[[1]] = 2; While[c < len && n <= nmax, bw = DigitCount[n, 2, 1]; If[bw <= len && s[[bw]] < 0, dbw = DivisorSum[n, DigitCount[#, 2, 1] &]; If[dbw == 2*bw, c++; s[[bw]] = n]]; n += 2]; s]; seq[16, 10^6]

%o (PARI) lista(len, nmax) = {my(s = vector(len,i,-1), n = 3, c = 2, bw, dbw); s[1] = 2; while(c < len && n <= nmax, bw = hammingweight(n); if(bw <= len && s[bw] < 0, dbw = sumdiv(n, d, hammingweight(d)); if(dbw == 2*bw, c++; s[bw] = n)); n += 2); s};

%Y Cf. A000120, A093653, A175522.

%K nonn,base

%O 1,1

%A _Amiram Eldar_, Feb 15 2023