|
|
A350091
|
|
a(n) = a(floor(n/4)) for n == 2 (mod 4), otherwise n.
|
|
2
|
|
|
0, 1, 0, 3, 4, 5, 1, 7, 8, 9, 0, 11, 12, 13, 3, 15, 16, 17, 4, 19, 20, 21, 5, 23, 24, 25, 1, 27, 28, 29, 7, 31, 32, 33, 8, 35, 36, 37, 9, 39, 40, 41, 0, 43, 44, 45, 11, 47, 48, 49, 12, 51, 52, 53, 13, 55, 56, 57, 3, 59, 60, 61, 15, 63, 64, 65, 16, 67, 68, 69, 17, 71, 72, 73
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
a(n) deletes any trailing '10' bit pairs from n. So in base 4, it removes all trailing '2' digits.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
Numbers between '' are in base 2: '0'->'0', so a(0)=0. '110'->'1', so a(6)=1. '1010'->'10' -> '0', so a(10)=0. a(floor((2^1000001)/3))=0.
|
|
MATHEMATICA
|
a[n_] := a[n] = If[Mod[n, 4] == 2, a[(n - 2)/4], n]; Array[a, 100, 0] (* Amiram Eldar, Dec 14 2021 *)
|
|
PROG
|
(PARI) a(n) = if(2!=(n%4), n, my(m=3*n+2); m=m/4^valuation(m, 4); (m+1)/3-1)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|