login
A032821
Numbers whose set of base-9 digits is {1,4}.
1
1, 4, 10, 13, 37, 40, 91, 94, 118, 121, 334, 337, 361, 364, 820, 823, 847, 850, 1063, 1066, 1090, 1093, 3007, 3010, 3034, 3037, 3250, 3253, 3277, 3280, 7381, 7384, 7408, 7411, 7624, 7627, 7651, 7654, 9568, 9571, 9595, 9598
OFFSET
1,2
FORMULA
a(1)=1, a(2)=4; a(n) = 9*a(floor(n/2))+1 for n odd, otherwise a(n) = 9*a(floor((n-1)/2))+4. - Bruno Berselli, May 28 2012
MATHEMATICA
Select[Range[9600], MemberQ[{{1}, {4}, {1, 4}}, Union[IntegerDigits[ #, 9]]]&] (* Harvey P. Dale, Jul 24 2011 *)
Flatten[Table[FromDigits[#, 9]&/@Tuples[{1, 4}, n], {n, 5}]] (* Vincenzo Librandi, May 28 2012 *)
PROG
(Magma) [n: n in [1..10000] | Set(IntegerToSequence(n, 9)) subset {1, 4}]; // Vincenzo Librandi, May 28 2012
(Maxima) a[1]:1$ a[2]:4$ a[n]:= if oddp(n) then 9*a[floor(n/2)]+1 else 9*a[floor((n-1)/2)]+4$ makelist(a[n], n, 1, 42); /* Bruno Berselli, May 28 2012 */
CROSSREFS
Sequence in context: A173931 A173793 A076270 * A101576 A179134 A103044
KEYWORD
nonn,base,easy
STATUS
approved