OFFSET
1,1
LINKS
FORMULA
a(2^n - floor(n/2)) = 4*2^n + 1, for all n >= 0. - Gheorghe Coserea, Oct 24 2016
EXAMPLE
Binary expansions of odd integers in decimal and binary forms are as follows:
1 -> 1, no;
3 -> 11, no;
5 -> 101, yes, so a(1)=5;
7 -> 111, no;
9 -> 1001, yes so a(2)=9;
11 -> 1011, no;
13 -> 1101, no;
15 -> 1111, no;
17 -> 10001, yes so a(3)=17.
MATHEMATICA
BNDigits[m_Integer] :=
Module[{n = m, d, t = {}},
While[n > 0, d = Mod[n, 2]; PrependTo[t, d]; n = (n - d)/2]; t];
c = 1;
Table[While[c = c + 2; d = BNDigits[c]; ld = Length[d];
c1 = Total[d]; ! (EvenQ[c1] && (c1 < ld))]; c, {n, 1, 57}]
PROG
(PARI) isok(n) = my(b=binary(n)); (n % 2) && (vecmin(b)==0) && !(vecsum(b) % 2); \\ Michel Marcus, Oct 21 2016
(PARI)
seq(N) = {
my(bag = List(), cnt = 0, n = 1);
while(cnt < N,
if (hammingweight(n)%2 == 0 && hammingweight(n+1) > 1,
listput(bag, n); cnt++);
n += 2);
return(Vec(bag));
};
seq(57) \\ Gheorghe Coserea, Oct 25 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Lei Zhou, Oct 20 2016
STATUS
approved