login
Numbers k such that k/4^m == 1 (mod 4), where 4^m is the greatest power of 4 that divides k.
3

%I #22 Jul 09 2022 11:06:26

%S 1,4,5,9,13,16,17,20,21,25,29,33,36,37,41,45,49,52,53,57,61,64,65,68,

%T 69,73,77,80,81,84,85,89,93,97,100,101,105,109,113,116,117,121,125,

%U 129,132,133,137,141,144,145,148,149,153,157,161,164,165,169,173

%N Numbers k such that k/4^m == 1 (mod 4), where 4^m is the greatest power of 4 that divides k.

%C Positions of 1 in A065882.

%C This is one sequence in a 3-way splitting of the positive integers; the other two are A036554 and A055050, as in the Mathematica program.

%C The asymptotic density of this sequence is 1/3. - _Amiram Eldar_, Mar 08 2021

%H Clark Kimberling, <a href="/A277549/b277549.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Ar#2-automatic">Index entries for 2-automatic sequences</a>.

%p filter:= n -> n/2^(2*floor(padic:-ordp(n,2)/2)) mod 4 = 1:

%p select(filter, [$1..1000]); # _Robert Israel_, Oct 20 2016

%t z = 160; a[b_] := Table[Mod[n/b^IntegerExponent[n, b], b], {n, 1, z}];

%t p[b_, d_] := Flatten[Position[a[b], d]];

%t p[4, 1] (* A277549 *)

%t p[4, 2] (* A036554 *)

%t p[4, 3] (* A055050 *)

%o (PARI) isok(n) = n/4^valuation(n,4) % 4 == 1; \\ _Michel Marcus_, Oct 20 2016

%o (Python)

%o from itertools import count, islice

%o def A277549_gen(startvalue=1): # generator of terms >= startvalue

%o return filter(lambda n:(n>>((~n&n-1).bit_length()&-2))&3==1,count(max(startvalue,1)))

%o A277549_list = list(islice(A277549_gen(),30)) # _Chai Wah Wu_, Jul 09 2022

%Y Cf. A065882, A036554, A055050.

%K nonn,easy

%O 1,2

%A _Clark Kimberling_, Oct 20 2016