OFFSET
1,1
MATHEMATICA
Flatten@ Table[FromDigits /@ Tuples[{7, 9}, n], {n, 5}] (* Giovanni Resta, Apr 10 2017 *)
PROG
(Magma) [n: n in [1..100000] | Set(IntegerToSequence(n, 10)) subset {7, 9}]
(PARI) a(n, {p=[7, 9]})={my(v=binary(n+1)); fromdigits(vector(#v-1, i, p[2]*v[i+1]+p[1]*!v[i+1]))} \\ R. J. Cano, Apr 09 2017
(Python)
def a(n): return int(bin(n+1)[3:].replace('0', '7').replace('1', '9'))
print([a(n) for n in range(1, 45)]) # Michael S. Branicky, Jul 09 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jaroslav Krizek, Apr 08 2017
STATUS
approved