[go: up one dir, main page]

login
a(n) is the smallest number that has exactly n evil divisors (A001969).
4

%I #28 Aug 26 2022 07:37:32

%S 1,3,6,12,18,45,30,135,72,60,90,765,120,1575,270,180,600,3465,480,

%T 13545,360,540,1530,10395,1260,720,3150,1980,1080,49725,1440,45045,

%U 2520,3060,6930,2160,3780,58905,27090,6300,5040,184275,4320,135135,6120,7920,20790,329175,7560,8640

%N a(n) is the smallest number that has exactly n evil divisors (A001969).

%C Differs from A327328 since a(7) = 135 while A327328(7) = 105.

%H David A. Corneth, <a href="/A356019/b356019.txt">Table of n, a(n) for n = 0..396</a>

%H David A. Corneth, <a href="/A356019/a356019_1.gp.txt">Upperbounds on a(n), terms <= 8*10^9 are certain</a>

%F a(n) <= A356040(n). - _David A. Corneth_, Jul 26 2022

%e a(4) = 18 since 18 has six divisors: {1, 2, 3, 6, 9, 18} of which four {3, 6, 9, 18} have an even number of 1's in their binary expansion: 11, 110, 1001 and 10010 respectively; also, no positive integer smaller than 18 has exactly four divisors that are evil.

%p # output in unsorted b-file style

%p A356019_list := [seq(0,i=1..1000)] ;

%p for n from 1 do

%p evd := A356018(n) ;

%p if evd < nops(A356019_list) then

%p if op(evd+1,A356019_list) <= 0 then

%p printf("%d %d\n",evd,n) ;

%p A356019_list := subsop(evd+1=n,A356019_list) ;

%p end if;

%p end if;

%p end do: # _R. J. Mathar_, Aug 07 2022

%t f[n_] := DivisorSum[n, 1 &, EvenQ[DigitCount[#, 2, 1]] &]; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n] + 1; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[50, 10^6] (* _Amiram Eldar_, Jul 23 2022 *)

%o (Python)

%o from sympy import divisors

%o from itertools import count, islice

%o def c(n): return bin(n).count("1")&1 == 0

%o def f(n): return sum(1 for d in divisors(n, generator=True) if c(d))

%o def agen():

%o n, adict = 0, dict()

%o for k in count(1):

%o fk = f(k)

%o if fk not in adict: adict[fk] = k

%o while n in adict: yield adict[n]; n += 1

%o print(list(islice(agen(), 50))) # _Michael S. Branicky_, Jul 23 2022

%Y Cf. A001969, A093688, A227872, A327328, A356018, A356020, A356040.

%Y Similar sequences: A087997, A333456, A355303, A355699, A355968.

%K nonn,base

%O 0,2

%A _Bernard Schott_, Jul 23 2022

%E More terms from _Amiram Eldar_, Jul 23 2022