OFFSET
0,3
COMMENTS
Alternate definition: starting with a(0) = 0, include 2n if n is in the sequence, and include 2n+1 if no two previous terms sum to 2n+1.
It suffices to prove this for odd n. If n == 3(6), n-2 == 1 (mod 6); if n == 5 (mod 6), n-4 == 1 (mod 6). However, if n == 1 (mod 6), any even k in the sequence, 0 < k < n, will have k !== 0 (mod 3), and so n-k != 1 (mod 3), so it is not in the sequence; thus n must be.
Every nonnegative integer is the sum of two members of this sequence; every positive integer is the sum of two distinct members of this sequence. For odd n, this is by the construction in the alternate definition; and for even n, by induction n/2 = i + j, and so n = 2i + 2j.
It follows that:
* No member of this sequence except 0 is a multiple of 3.
* The sequence has a density of 1/3.
* The difference between consecutive terms is always one of {1, 2, 3, 5, 6}, and each of these occurs infinitely often, with 1 having density 1/3 and the others having density 1/6.
* The sequence is closed under multiplication.
* The primes in the sequence are A045375.
LINKS
Franklin T. Adams-Watters, Table of n, a(n) for n = 0..10000
FORMULA
n is in the sequence if and only if n = 0 or A000265(n) == 1 (mod 6). [Clarified by Peter Munn, Jun 11 2021]
n is in the sequence if n = 0 or b(n) is nonzero where b = A113448, A115235, or A123863. - Michael Somos, Jul 29 2015
EXAMPLE
Using the alternate definition:
1 is in the sequence because it is not the sum of 2 elements from {0}.
2 is in the sequence because 2 = 2*1, and 1 is in the sequence.
3 is not in the sequence because 3 = 1 + 2, and 1 and 2 are in the sequence.
6 is not in the sequence because 6 = 2*3, and 3 is not in the sequence.
MAPLE
N:= 1000: # to get all terms <= N
sort([0, seq(seq(2^m*(6*k+1), k = 0 .. floor((N/2^m - 1)/6)), m = 0 .. ilog2(N))]); # Robert Israel, Aug 25 2015
MATHEMATICA
mx=160; Join[{0}, Sort@Flatten@Table[2^m*(6k+1), {m, 0, Log2[mx]}, {k, 0, mx/(6*2^m)}]] (* Robert G. Wilson v, Aug 16 2015 *)
PROG
(PARI) alist(n) = my(r=vector(n), j, k); r[1]=0; j=1; while(j<n, k++; if(k\2^valuation(k, 2)%6==1, r[j++]=k)); r
(PARI) alim(n)={my(p=1, p2=p, r, j);
for(k=1, n,
if(if(k%2==0, polcoeff(p, k\2), polcoeff(p2, k)==0), p+=x^k; p2+=x^k*p));
r=vector(subst(p, x, 1)); for(k=0, n, if(polcoeff(p, k), r[j++]=k)); r}
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
Franklin T. Adams-Watters, Jul 27 2015
STATUS
approved