A182419 a(0)=0, a(n+1) = (a(n) XOR floor(a(n)/8)) + 1, where XOR is the bitwise exclusive-or operator.
0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 19, 18, 17, 20, 23, 22, 21, 24, 28, 32, 37, 34, 39, 36, 33, 38, 35, 40, 46, 44, 42, 48, 55, 50, 53, 52, 51, 54, 49, 56, 64, 73, 65, 74, 68, 77, 69, 78, 72, 66, 75, 67, 76, 70, 79, 71, 80, 91, 81, 92, 88, 84, 95
Offset: 0
Programs
-
C
#include
int main(int argc, char **argv) { unsigned long long a=0; for (int j=0; j<1000; ++j) { printf("%llu, ", a); a = (a^(a/8)) + 1; } return 0; // indices of 2^x: see C program of A182310. } // from Alex Ratushnyak, Apr 27 2012 -
PARI
N=100; v=vector(N); for (n=1, N-1, v[n+1] = bitxor( v[n], v[n] \ 8 ) + 1 ); v /* show terms */ /* Joerg Arndt, Apr 28 2012 */
Comments