login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A193508
a(n) = n if n is not a power of 2 and a(2^n) = a(n).
0
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, 26, 27, 28, 29, 30, 31, 5, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6, 65, 66, 67, 68
OFFSET
0,4
MATHEMATICA
fra[n_] := fra[n]= If[IntegerQ[Log[2, n]] == False, n, fra[Log[2, n]]]; Table[fra[n], {n, 0, 211}]
PROG
(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
CROSSREFS
Sequence in context: A102391 A038556 A342303 * A307728 A263199 A052483
KEYWORD
nonn,easy
AUTHOR
STATUS
approved