A284636 Numbers with digits 6 and 9 only.
6, 9, 66, 69, 96, 99, 666, 669, 696, 699, 966, 969, 996, 999, 6666, 6669, 6696, 6699, 6966, 6969, 6996, 6999, 9666, 9669, 9696, 9699, 9966, 9969, 9996, 9999, 66666, 66669, 66696, 66699, 66966, 66969, 66996, 66999, 69666, 69669, 69696, 69699, 69966, 69969
Offset: 1
Links
- Felix Fröhlich, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Magma
[n: n in [1..100000] | Set(IntegerToSequence(n, 10)) subset {6, 9}]
-
Mathematica
Table[FromDigits /@ Tuples[{6, 9}, n], {n, 5}] // Flatten (* or *) Select[Range@ 70000, Total@ Pick[DigitCount@ #, {0, 0, 0, 0, 0, 1, 0, 0, 1, 0}, 0] == 0 &] (* Michael De Vlieger, Apr 02 2017 *)
-
PARI
a(n) = { my(z, e = logint(n+1,2,&z), t1 = 9 * subst(Pol(binary(n+1-z),'x), 'x, 10), t2 = 6 * subst(Pol(binary(2*z-2-n),'x), 'x, 10)); t1+t2; }; vector(44, n, a(n)) \\ Gheorghe Coserea, Apr 04 2017
-
Python
def a(n): return int(bin(n+1)[3:].replace('0', '6').replace('1', '9')) print([a(n) for n in range(1, 45)]) # Michael S. Branicky, Jun 09 2021
Formula
a(n) = 3 * A032810(n).
Comments