%I #15 Sep 08 2022 08:44:51
%S 1,4,6,9,21,24,31,34,46,49,106,109,121,124,156,159,171,174,231,234,
%T 246,249,531,534,546,549,606,609,621,624,781,784,796,799,856,859,871,
%U 874,1156,1159,1171,1174,1231,1234,1246,1249,2656
%N Numbers whose set of base-5 digits is {1,4}.
%H Vincenzo Librandi, <a href="/A032817/b032817.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Ar#5-automatic">Index entries for 5-automatic sequences</a>.
%F a(1)=1, a(2)=4; a(n) = 5*a(floor(n/2))+1 for n odd, otherwise a(n) = 5*a(floor((n-1)/2))+4. - _Bruno Berselli_, May 28 2012
%t Flatten[Table[FromDigits[#,5]&/@Tuples[{1,4},n],{n,5}]] (* _Vincenzo Librandi_, May 27 2012 *)
%o (Magma) [n: n in [1..3000] | Set(IntegerToSequence(n, 5)) subset {1, 4}]; // _Vincenzo Librandi_, May 27 2012
%o (Maxima) a[1]:1$ a[2]:4$ a[n]:= if oddp(n) then 5*a[floor(n/2)]+1 else 5*a[floor((n-1)/2)]+4$ makelist(a[n],n,1,47); /* _Bruno Berselli_, May 28 2012 */
%K nonn,base,easy
%O 1,2
%A _Clark Kimberling_
|