OFFSET
1,2
COMMENTS
See A001743 for the other version.
If n-1 is represented as a base-5 number (see A007091) according to n-1 = d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n)= Sum_{j=0..m} c(d(j))*10^j, where c(k)=0,4,6,8,9 for k=0..4. - Hieronymus Fischer, May 30 2012
LINKS
Hieronymus Fischer, Table of n, a(n) for n = 1..10000
FORMULA
From Hieronymus Fischer, May 30 2012: (Start)
a(n) = ((2*b_m(n)) mod 8 + 4 + floor(b_m(n)/4) - floor((b_m(n)+1)/4))*10^m + sum_{j=0..m-1} ((2*b_j(n))) mod 10 + 2*floor((b_j(n)+4)/5) - floor((b_j(n)+1)/5) -floor(b_j(n)/5)))*10^j, where n>1, b_j(n)) = floor((n-1-5^m)/5^j), m = floor(log_5(n-1)).
a(1*5^n+1) = 4*10^n.
a(2*5^n+1) = 6*10^n.
a(3*5^n+1) = 8*10^n.
a(4*5^n+1) = 9*10^n.
a(n) = 4*10^log_5(n-1) for n=5^k+1,
a(n) < 4*10^log_5(n-1), otherwise.
a(n) > 10^log_5(n-1) n>1.
G.f.: g(x) = (x/(1-x))*sum_{j>=0} 10^j*x^5^j*(1-x^5^j)*(4 + 6x^5^j + 8(x^2)^5^j + 9(x^3)^5^j)/(1-x^5^(j+1)).
Also: g(x) = (x/(1-x))*(4*h_(5,1)(x) + 2*h_(5,2)(x) + 2*h_(5,3)(x) + h_(5,4)(x) - 9*h_(5,5)(x)), where h_(5,k)(x) = sum_{j>=0} 10^j*(x^5^j)^k/(1-(x^5^j)^5). (End)
EXAMPLE
a(1000) = 46999.
a(10^4) = 809999.
a(10^5) = 44499999.
a(10^6) = 668999999.
MATHEMATICA
FromDigits/@Tuples[{0, 4, 6, 8, 9}, 3] (* Harvey P. Dale, Aug 16 2018 *)
PROG
(PARI) is(n) = #setintersect(vecsort(digits(n), , 8), [1, 2, 3, 5, 7])==0 \\ Felix Fröhlich, Sep 09 2019
CROSSREFS
KEYWORD
base,nonn,easy
AUTHOR
EXTENSIONS
Ambiguous comment deleted by Zak Seidov, May 25 2010
Examples added by Hieronymus Fischer, May 30 2012
STATUS
approved