A230499 a(n) is the maximal number k of consecutive numbers of the form (2*n-1)*(2*i-1), i=1,2,...,k, which are all evil or all odious (A000069, A001969).
1, 3, 2, 4, 4, 1, 1, 9, 8, 1, 1, 1, 1, 1, 1, 16, 16, 1, 1, 1, 1, 3, 4, 1, 1, 3, 2, 1, 1, 1, 1, 33, 32, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 2, 2, 2, 5, 1, 1, 5, 2, 4, 20, 4, 3, 1, 1, 4, 2, 1, 1, 1, 1, 64, 64, 1, 1, 1, 1, 2, 4, 1, 1, 3, 4, 5, 4, 3, 2, 1, 1, 2, 4, 3, 3, 1, 1
Offset: 1
Examples
For n=2, t=2*n-1=3. We see that 3*1=3, 3*3=9,3*5=15 are evil, but 3*7=21 is odious. So, a(2)=3.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
- V. Shevelev, "Odious-evil stability" of integers
Programs
-
PARI
a(n)=my(t=2*n-1,H=hammingweight(t)%2,i=3); while(H == hammingweight(i*t)%2, i+=2); i\2 \\ Charles R Greathouse IV, Oct 22 2013
Formula
Extensions
a(17)-a(87) from Charles R Greathouse IV, Oct 22 2013
Comments