A256290 Numbers which have only digits 4 and 5 in base 10.
4, 5, 44, 45, 54, 55, 444, 445, 454, 455, 544, 545, 554, 555, 4444, 4445, 4454, 4455, 4544, 4545, 4554, 4555, 5444, 5445, 5454, 5455, 5544, 5545, 5554, 5555, 44444, 44445, 44454, 44455, 44544, 44545, 44554, 44555, 45444, 45445, 45454, 45455, 45544
Offset: 1
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..8190
- Index entries for 10-automatic sequences.
Crossrefs
Programs
-
Magma
[n: n in [1..60000] | Set(IntegerToSequence(n, 10)) subset {5, 4}];
-
Magma
[n: n in [1..100000] | Set(Intseq(n)) subset {4,5}]; // Vincenzo Librandi, Aug 19 2016
-
Mathematica
Flatten[Table[FromDigits[#,10]&/@Tuples[{4,5},n],{n,5}]]
-
PARI
A256290(n)=vector(#n=binary(n+1)[2..-1],i,10^(#n-i))*n~+10^#n\9*4
-
Python
def A256290(n): return int(bin(n+1)[3:])+(10**((n+1).bit_length()-1)-1<<2)//9 # Chai Wah Wu, Jul 15 2023