login
Numbers n that have an equal number of even and odd values of A001221(k) for 1 <= k <= n.
6

%I #28 Aug 03 2016 09:03:37

%S 2,40,46,48,50,7960,7962,7984,7986,8808,8810,8812,8816,8822,8824,8826,

%T 8828,8830,8836,8844,8846,8848,8850,8854,8856,8858,8860,8862,8864,

%U 8866,8872,8878,8970,8972,8974,9064,9078,9080,9082,9084,9086,9088,9096,9164,9220

%N Numbers n that have an equal number of even and odd values of A001221(k) for 1 <= k <= n.

%C Is this sequence infinite?

%H Giovanni Resta, <a href="/A275547/b275547.txt">Table of n, a(n) for n = 1..10000</a>

%F A174863(a(n)) = 0. - _Alois P. Heinz_, Aug 02 2016

%e a(2) = 40 because if we check omega(n) = A001221(n) for each n = 1..40, then half will be even numbers and half will be odd numbers.

%p omega:= n-> nops(numtheory[factorset](n)):

%p b:= proc(n) option remember; (-1)^omega(n)+`if`(n>1, b(n-1), 0) end:

%p a:= proc(n) option remember; local k; for k from 1+

%p `if`(n=1, 0, a(n-1)) while b(k)<>0 do od; k

%p end:

%p seq(a(n), n=1..50); # _Alois P. Heinz_, Aug 02 2016

%t a[1] = 2; a[n_] := a[n] = Block[{k = a[n-1], s=0}, While[(s += (-1)^ PrimeNu[++k]) != 0]; k]; Array[a, 100] (* _Giovanni Resta_, Aug 03 2016 *)

%o (PARI) is(n) = my(i=0, j=0); for(k=1, n, if(omega(k)%2==0, i++, j++)); if(i==j, return(1), return(0)) \\ _Felix Fröhlich_, Aug 02 2016

%o (PARI) isok(n) = {my(v = vector(n, k, omega(k))); #select(x->x % 2 == 1, v) == n/2;} \\ _Michel Marcus_, Aug 02 2016

%Y Cf. A001221, A005408, A005843, A174863.

%K nonn

%O 1,1

%A _G. L. Honaker, Jr._, Aug 01 2016

%E More terms from _Alois P. Heinz_, Aug 02 2016