OFFSET

1,1

COMMENTS

Apart from the first term, all terms are odd.

EXAMPLE

2 = 2^1 has Hamming weight 1 and so a(1) = 2.

3 = 2^1 + 2^0 has Hamming weight 2, and any multiple of 3 has a Hamming weight at least as high, so a(2) = 3.

5 = 2^2 + 2^0 has Hamming weight 2 and so similarly a(3) = 5.

7 = 2^2 + 2^1 + 2^0 has Hamming weight 3, and all powers of 2 are 1, 2, or 4 mod 7, and so all multiples of 7 have Hamming weight at least 3, so a(4) = 7.

11 = 2^3 + 2^1 + 2^0 has Hamming weight 3 but 33 = 2^5 + 2^0 has Hamming weight 2 so a(5) = 33.

PROG

(PARI) min1s(p)=my(o=znorder(Mod(2, p)), v1=Set(powers(Mod(2, p), o)), v=v1, s=1); while(!setsearch(v, Mod(0, p)), v=setbinop((x, y)->x+y, v, v1); s++); s

a(n, p=prime(n))=my(m=min1s(p), t=p, k=2*p); while(hammingweight(t)>m, t+=k); t

CROSSREFS

KEYWORD

nonn,more

AUTHOR

Charles R Greathouse IV, Dec 02 2016

EXTENSIONS

a(23)-a(25) from Charles R Greathouse IV, Dec 09 2016

STATUS

approved