OFFSET
0,3
COMMENTS
No more than one 1-bit in each bit triple.
All terms satisfy A048727(n) = 7*n.
It appears that n is in the sequence if and only if C(7n,n) is odd (cf. A003714). - Benoit Cloitre, Mar 09 2003
The conjecture by Benoit is correct. This is easily proved using the well-known result that the multiplicity with which a prime p divides C(n+m,n) is the number of carries when adding n+m in base p. - Franklin T. Adams-Watters, Oct 06 2009
Appears to be the set of numbers x such that (x AND 5*x) = x and (x OR 3*x)/x = 3. - Gary Detlefs, Jun 08 2024
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1275
Sebastian Karlsson, Walnut code that verifies the conjectures of Paul D. Hanna
Walnut can be downloaded from https://cs.uwaterloo.ca/~shallit/walnut.html.
FORMULA
a(0) = 0, a(n) = (2^(invfoo(n)-1))+a(n-foo(invfoo(n))), where foo(n) is foo(n-1) + foo(n-3) (A000930) and invfoo is its "integral" (floored down) inverse.
a(n) XOR 6*a(n) = 7*a(n); 3*a(n) XOR 4*a(n) = 7*a(n); 3*a(n) XOR 5*a(n) = 6*a(n); (conjectures). - Paul D. Hanna, Jan 22 2006
The conjectures can be verified using the Walnut theorem-prover (see links). - Sebastian Karlsson, Dec 31 2022
MATHEMATICA
Reap[Do[If[OddQ[Binomial[7n, n]], Sow[n]], {n, 0, 400}]][[2, 1]]
(* Second program: *)
filterQ[n_] := With[{bb = IntegerDigits[n, 2]}, !MatchQ[bb, {___, 1, 0, 1, ___}|{___, 1, 1, ___}]];
Select[Range[0, 580], filterQ] (* Jean-François Alcover, Dec 31 2020 *)
PROG
(PARI) is(n)=!bitand(n, 6*n) \\ Charles R Greathouse IV, Oct 03 2016
(Perl) for my $k (0..580) { print "$k, " if sprintf("%b", $k) =~ m{^(100(0)*)*(0|1|10)?$}; } # Georg Fischer, Jun 26 2021
(Python)
import re
def ok(n): return re.fullmatch('(100(0)*)*(0|1|10)?', bin(n)[2:]) != None
print(list(filter(ok, range(581)))) # Michael S. Branicky, Jun 26 2021
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Antti Karttunen, Mar 30 1999
EXTENSIONS
Definition corrected by Georg Fischer, Jun 26 2021
STATUS
approved