login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = n if n is not a power of 2 and a(2^n) = a(n).
0

%I #12 May 13 2013 01:49:54

%S 0,0,0,3,0,5,6,7,3,9,10,11,12,13,14,15,0,17,18,19,20,21,22,23,24,25,

%T 26,27,28,29,30,31,5,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,

%U 49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,6,65,66,67,68

%N a(n) = n if n is not a power of 2 and a(2^n) = a(n).

%t fra[n_] := fra[n]= If[IntegerQ[Log[2,n]] == False, n, fra[Log[2,n]]]; Table[fra[n], {n,0,211}]

%o (PARI) a(n)=if(n<3,0,if(#binary(n)!=#binary(n-1),a(#binary(n-1)),n)) \\ _Charles R Greathouse IV_, Jul 29 2011

%K nonn,easy

%O 0,4

%A _José María Grau Ribas_, Jul 29 2011