#C, 82 bytes, safe ####=############ main(i){scanf("%d",##); for(i=1;i++/4<#;)##=2; printf("%d",##);} Works with gcc, and it is a full program, which reads its input from stdin and prints its output to stdout. Here the sequence is <s>A004526, floor(n/2)</s>. a(0) = 0 a(1) = 0 a(2) = 1 a(3) = 1 a(4) = 2 a(5) = 2 a(6) = 3 a(7) = 3 a(8) = 4 <b>Solution:</b> a;*b=(char*)&a+1; main(i){scanf("%d",&a); for(i=1;i++/4<2;)a*=2; printf("%d",*b);} This works only on little endian machines, and only if the size of `char` is 1 byte. <br> And only if the byte higher than the highest order byte of `a` has value 0, which I think is true for gcc since by default uninitialized variables go into the bss segment, and initialized variables go into the data segment (see http://stackoverflow.com/questions/8721475/if-a-global-variable-is-initialized-to-0-will-it-go-to-bss).<br> So only `a` goes into bss (`b` is initialized), and if it is not at the end of bss, then there will be at least another byte higher than the highest order byte of a. This byte has value 0 and is the highest order byte of `*b`.