login
a(n) = Xmult(n,5) or rule90(n,1).
21

%I #32 Jul 06 2022 22:18:55

%S 0,5,10,15,20,17,30,27,40,45,34,39,60,57,54,51,80,85,90,95,68,65,78,

%T 75,120,125,114,119,108,105,102,99,160,165,170,175,180,177,190,187,

%U 136,141,130,135,156,153,150,147,240,245,250,255,228,225,238,235,216,221,210

%N a(n) = Xmult(n,5) or rule90(n,1).

%C The orbit of 1 under iteration of this function is the Sierpinski gasket A038183. It is called "rule 90" because the 8 bits of 90 = 01011010 in binary give bit k of the result as function of the value in {0,...,7} made out of bits k,k+1,k+2 of the input (i.e., floor(input / 2^k) mod 8). - _M. F. Hasler_, Oct 09 2017

%H Alois P. Heinz, <a href="/A048725/b048725.txt">Table of n, a(n) for n = 0..16383</a>

%F a(n) = n XOR n*2 XOR (n XOR n*2)*2 = A048724(A048724(n)). - _Reinhard Zumkeller_, Nov 12 2004

%F a(n) = n XOR (4n). - _M. F. Hasler_, Oct 09 2017

%e n (in binary) | 4n [binary] | n XOR 4n [binary] | [decimal] = a(n)

%e 0 | 0 | 0 | 0

%e 1 | 100 | 101 | 5

%e 10 | 1000 | 1010 | 10

%e 11 | 1100 | 1111 | 15

%e 100 | 10000 | 10100 | 20

%e 101 | 10100 | 10001 | 17

%e etc.

%p a:= n-> Bits[Xor](n*4, n):

%p seq(a(n), n=0..120); # _Alois P. Heinz_, Aug 24 2019

%t Table[ BitXor[4n, n], {n, 0, 60}] (* _Robert G. Wilson v_, Jul 06 2006 *)

%o (PARI) a(n)=bitxor(n,4*n) \\ _Charles R Greathouse IV_, Oct 03 2016

%o (Python)

%o def A048725(n): return n^ n<<2 # _Chai Wah Wu_, Jun 29 2022

%Y Cf. A048720, A048705, A048710, A048724, A048727, A048729.

%Y Cf. A038183.

%Y Cf. A353167 (terms sorted).

%K nonn,easy

%O 0,2

%A _Antti Karttunen_, Apr 26 1999