login
Numbers k for which there is an even number of nonzero digits when k is written in the factorial base (A007623).
10

%I #18 Jan 24 2024 01:48:52

%S 0,3,5,7,8,10,13,14,16,19,20,22,25,26,28,30,33,35,36,39,41,42,45,47,

%T 49,50,52,54,57,59,60,63,65,66,69,71,73,74,76,78,81,83,84,87,89,90,93,

%U 95,97,98,100,102,105,107,108,111,113,114,117,119,121,122,124

%N Numbers k for which there is an even number of nonzero digits when k is written in the factorial base (A007623).

%C This sequence offers one possible analog to A001969 (evil numbers) in the factorial base system. A227148 gives another kind of analog.

%C In each range [0,n!-1] exactly half of the integers are found in this sequence, and the other half of them are found in the complement, A227132.

%C The sequence gives the positions of even permutations in the tables A060117 and A060118.

%H Antti Karttunen, <a href="/A227130/b227130.txt">Table of n, a(n) for n = 1..2520</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Parity_of_a_permutation">Parity of permutation</a>.

%t q[n_] := Module[{k = n, m = 2, c = 0, r}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, If[r != 0, c++]; m++]; EvenQ[c]]; Select[Range[0, 150], q] (* _Amiram Eldar_, Jan 23 2024 *)

%o (Scheme, with _Antti Karttunen_'s IntSeq-library): (define A227130 (MATCHING-POS 1 0 (lambda (i) (even? (A060130 i)))))

%Y Complement: A227132. Cf. also A001969, A060130, A227148.

%K nonn,base

%O 1,2

%A _Antti Karttunen_, Jul 02 2013