login
A032820
Numbers whose set of base-8 digits is {1,4}.
1
1, 4, 9, 12, 33, 36, 73, 76, 97, 100, 265, 268, 289, 292, 585, 588, 609, 612, 777, 780, 801, 804, 2121, 2124, 2145, 2148, 2313, 2316, 2337, 2340, 4681, 4684, 4705, 4708, 4873, 4876, 4897, 4900, 6217, 6220, 6241, 6244, 6409
OFFSET
1,2
FORMULA
a(1)=1, a(2)=4; a(n) = 8*a(floor(n/2))+1 for n odd, otherwise a(n) = 8*a(floor((n-1)/2))+4. - Bruno Berselli, May 28 2012
MATHEMATICA
Flatten[Table[FromDigits[#, 8]&/@Tuples[{1, 4}, n], {n, 9}]] (* Vincenzo Librandi, May 28 2012 *)
PROG
(Magma) [n: n in [1..7000] | Set(IntegerToSequence(n, 8)) subset {1, 4}]; // Vincenzo Librandi, May 28 2012
(Maxima) a[1]:1$ a[2]:4$ a[n]:= if oddp(n) then 8*a[floor(n/2)]+1 else 8*a[floor((n-1)/2)]+4$ makelist(a[n], n, 1, 43); /* Bruno Berselli, May 28 2012 */
CROSSREFS
Sequence in context: A287498 A359301 A174911 * A197615 A125848 A225752
KEYWORD
nonn,base,easy
STATUS
approved