OFFSET
1,2
COMMENTS
Positions of 1 in A065882.
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.
The asymptotic density of this sequence is 1/3. - Amiram Eldar, Mar 08 2021
From Jules Beauchamp, Sep 10 2025: (Start)
This sequence includes all the squares. It also includes the sequence A016813 (numbers of the form 4*k + 1). Composite terms that are not multiples of previous terms are multiples of terms not already in the sequence.
All odd terms > 1 are sums of an odd and even already in the sequence, and apart from those of the form 4^m, all even terms are the sum of two previous even terms (but not the sum of two odd terms).
This sequence is fractal. For any term, k, divide all multiples of k in the sequence by k to return the original sequence.
If odd k is in the sequence then so also is 2*k - 1. If even k is in the sequence then so also is 2*k + 1. If k is in the sequence then so also is 4^m*k, 4^m*k + 1 and 4^m*k - 3. (End)
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..10000
MAPLE
filter:= n -> n/2^(2*floor(padic:-ordp(n, 2)/2)) mod 4 = 1:
select(filter, [$1..1000]); # Robert Israel, Oct 20 2016
MATHEMATICA
PROG
(PARI) isok(n) = n/4^valuation(n, 4) % 4 == 1; \\ Michel Marcus, Oct 20 2016
(Python)
from itertools import count, islice
def A277549_gen(startvalue=1): # generator of terms >= startvalue
return filter(lambda n:(n>>((~n&n-1).bit_length()&-2))&3==1, count(max(startvalue, 1)))
(Python)
def A277549(n):
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
kmin = kmax >> 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
def f(x): return n+x-sum(((x>>(i<<1))-1>>2)+1 for i in range((x.bit_length()>>1)+1))
return bisection(f, n, n) # Chai Wah Wu, Mar 19 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Oct 20 2016
STATUS
approved
