%I
%S 0,1,2,2,1,5,6,7,3,4,10,11,12,8,9,10,9,8,12,11,5,4,3,7,6,
%T 25,26,27,23,24,30,31,32,28,29,35,36,37,33,34,15,16,17,13,14,20,21,22,
%U 18,19,50,51,52,48,49,55,56,57,53,54,60,61,62,58,59,40,41
%N Balanced quinary (base 5) enumeration (or balanced quinary representation) of integers, write n in quinary, and then replace 3's with (2)'s and 4's with (1)'s.
%C This sequence, like the balanced ternary sequence, will eventually include every integer exactly once.
%H Alois P. Heinz, <a href="/A309991/b309991.txt">Table of n, a(n) for n = 0..15624</a>
%p a:= proc(n) option remember; `if`(n=0, 0,
%p 5*a(iquo(n, 5))+mods(n, 5))
%p end:
%p seq(a(n), n=0..100); # _Alois P. Heinz_, Aug 26 2019
%t Table[FromDigits[IntegerDigits[n,5]/.{3>2,4>1},5],{n,0,120}] (* _Harvey P. Dale_, Sep 05 2020 *)
%o (PARI) a(n) = subst(Pol(apply(d>if(d>2, d5, d), digits(n, 5)), 'x), 'x, 5) \\ _Andrew Howroyd_, Aug 26 2019
%Y Cf. A117966.
%Y Column k=2 of A319047.
%K sign,base
%O 0,3
%A _Jackson Haselhorst_, Aug 26 2019
