cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A277549 #30 Apr 22 2025 04:33:34
%S A277549 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 A277549 69,73,77,80,81,84,85,89,93,97,100,101,105,109,113,116,117,121,125,
%U A277549 129,132,133,137,141,144,145,148,149,153,157,161,164,165,169,173
%N A277549 Numbers k such that k/4^m == 1 (mod 4), where 4^m is the greatest power of 4 that divides k.
%C A277549 Positions of 1 in A065882.
%C A277549 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 A277549 The asymptotic density of this sequence is 1/3. - _Amiram Eldar_, Mar 08 2021
%H A277549 Clark Kimberling, <a href="/A277549/b277549.txt">Table of n, a(n) for n = 1..10000</a>
%H A277549 <a href="/index/Ar#2-automatic">Index entries for 2-automatic sequences</a>.
%p A277549 filter:= n -> n/2^(2*floor(padic:-ordp(n,2)/2)) mod 4 = 1:
%p A277549 select(filter, [$1..1000]); # _Robert Israel_, Oct 20 2016
%t A277549 z = 160; a[b_] := Table[Mod[n/b^IntegerExponent[n, b], b], {n, 1, z}];
%t A277549 p[b_, d_] := Flatten[Position[a[b], d]];
%t A277549 p[4, 1] (* A277549 *)
%t A277549 p[4, 2] (* A036554 *)
%t A277549 p[4, 3] (* A055050 *)
%o A277549 (PARI) isok(n) = n/4^valuation(n,4) % 4 == 1; \\ _Michel Marcus_, Oct 20 2016
%o A277549 (Python)
%o A277549 from itertools import count, islice
%o A277549 def A277549_gen(startvalue=1): # generator of terms >= startvalue
%o A277549     return filter(lambda n:(n>>((~n&n-1).bit_length()&-2))&3==1,count(max(startvalue,1)))
%o A277549 A277549_list = list(islice(A277549_gen(),30)) # _Chai Wah Wu_, Jul 09 2022
%o A277549 (Python)
%o A277549 def A277549(n):
%o A277549     def bisection(f,kmin=0,kmax=1):
%o A277549         while f(kmax) > kmax: kmax <<= 1
%o A277549         kmin = kmax >> 1
%o A277549         while kmax-kmin > 1:
%o A277549             kmid = kmax+kmin>>1
%o A277549             if f(kmid) <= kmid:
%o A277549                 kmax = kmid
%o A277549             else:
%o A277549                 kmin = kmid
%o A277549         return kmax
%o A277549     def f(x): return n+x-sum(((x>>(i<<1))-1>>2)+1 for i in range((x.bit_length()>>1)+1))
%o A277549     return bisection(f,n,n) # _Chai Wah Wu_, Mar 19 2025
%Y A277549 Cf. A065882, A036554, A055050.
%K A277549 nonn,easy
%O A277549 1,2
%A A277549 _Clark Kimberling_, Oct 20 2016