|
|
A256340
|
|
Numbers which have only digits 7 and 8 in base 10.
|
|
10
|
|
|
7, 8, 77, 78, 87, 88, 777, 778, 787, 788, 877, 878, 887, 888, 7777, 7778, 7787, 7788, 7877, 7878, 7887, 7888, 8777, 8778, 8787, 8788, 8877, 8878, 8887, 8888, 77777, 77778, 77787, 77788, 77877, 77878, 77887, 77888, 78777, 78778, 78787, 78788, 78877, 78878
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
Flatten[Table[FromDigits[#, 10]&/@Tuples[{7, 8}, n], {n, 5}]]
|
|
PROG
|
(Magma) [n: n in [1..35000] | Set(IntegerToSequence(n, 10)) subset {7, 8}];
(PARI) A256340(n)=vector(#n=binary(n+1)[2..-1], i, 10^(#n-i))*n~+10^#n\9*7
(Magma) [n: n in [1..100000] | Set(Intseq(n)) subset {7, 8}]; // Vincenzo Librandi, Aug 19 2016
(Python)
def a(n): return int(bin(n+1)[3:].replace('0', '7').replace('1', '8'))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|