%I #25 Sep 05 2023 05:41:04
%S 1,3,5,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767
%N Integers m such that only 2 binomial coefficients C(m,k), with 0<=k<=m, are practical numbers.
%C Integers m such that A334082(m) = m-1.
%C Integers of the form 2^k-1 (A000225) with k>0 are terms, but this condition is not necessary since 5 is a term.
%o (PARI) isok(n) = sum(k=0, n, !is_A005153(binomial(n, k))) == n-1;
%o (Python)
%o from itertools import count, islice
%o from math import comb
%o from sympy import factorint
%o def A334084_gen(startvalue=1): # generator of terms >= startvalue
%o for n in count(max(startvalue,1)):
%o for k in range(1,n):
%o c = comb(n,k)
%o l = (~c & c-1).bit_length()
%o if l>0:
%o P = (1<<l+1)-1
%o for p, e in factorint(c>>l).items():
%o if p > 1+P:
%o break
%o P *= (p**(e+1)-1)//(p-1)
%o else:
%o break
%o else:
%o yield n
%o A334084_list = list(islice(A334084_gen(),10)) # _Chai Wah Wu_, Jul 05 2023
%Y Cf. A005153 (practical numbers), A007318 (binomial coefficients).
%Y Cf. A334082, A334083.
%K nonn,more
%O 1,2
%A _Michel Marcus_, Apr 14 2020
%E a(11) from _Jinyuan Wang_, Apr 14 2020
%E a(12)-a(16) from _Chai Wah Wu_, Jul 05 2023
|