|
|
A014261
|
|
Numbers that contain odd digits only.
|
|
61
|
|
|
1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 31, 33, 35, 37, 39, 51, 53, 55, 57, 59, 71, 73, 75, 77, 79, 91, 93, 95, 97, 99, 111, 113, 115, 117, 119, 131, 133, 135, 137, 139, 151, 153, 155, 157, 159, 171, 173, 175, 177, 179, 191, 193, 195, 197, 199, 311, 313, 315, 317, 319
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Or, numbers whose product of digits is odd.
If n is represented as a zerofree base-5 number (see A084545) according to n = 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) = 1, 3, 5, 7, 9 for k = 1..5. - Hieronymus Fischer, Jun 06 2012
|
|
LINKS
|
|
|
FORMULA
|
a(n+1) = h(a(n)) with h(x) = 1 + (if x mod 10 < 9 then x + x mod 2 else 10*h(floor(x/10)));
a(n) = f(n, 1) where f(n, x) = if n = 1 then x else f(n-1, h(x)). (End)
a(n) = Sum_{j = 0..m-1} ((2*b_j(n)+1) mod 10)*10^j, where b_j(n)) = floor((4*n+1-5^m)/(4*5^j)), m = floor(log_5(4*n+1)).
a(1*(5^n-1)/4) = 1*(10^n-1)/9.
a(2*(5^n-1)/4) = 1*(10^n-1)/3.
a(3*(5^n-1)/4) = 5*(10^n-1)/9.
a(4*(5^n-1)/4) = 7*(10^n-1)/9.
a(5*(5^n-1)/4) = 10^n - 1.
a((5^n-1)/4 + 5^(n-1)-1) = (10^n-5)/5.
a(n) = (10^log_5(4*n+1)-1)/9 for n = (5^k-1)/4, k > 0.
a(n) < (10^log_5(4*n+1)-1)/9 for (5^k-1)/4 < n < (5^(k+1)-1)/4, k > 0.
a(n) <= 27/(9*2^log_5(9)-1)*(10^log_5(4*n+1)-1)/9 for n > 0, equality holds for n = 2.
a(n) > 0.776*10^log_5(4*n+1)-1)/9 for n > 0.
a(n) >= A001742(n), equality holds for n = (5^k-1)/4, k > 0.
G.f.: g(x)= (x^(1/4)*(1-x))^(-1) Sum_{j >= 0} 10^j*z(j)^(5/4)*(1-z(j))*(1 + 3*z(j) + 5*z(j)^2 + 7*z(j)^3 + 9*z(j)^4)/(1-z(j)^5), where z(j) = x^5^j.
Also: g(x) = (1/(1-x))*(h_(5,0)(x) + 2*h_(5,1)(x) + 2*h_(5,2)(x) + 2*h_(5,3)(x) + 2*h_(5,4)(x) - 9*h_(5,5)(x)), where h_(5,k)(x) = Sum_{j >= 0} 10^j*x^((5^(j+1)-1)/4)*(x^5^j)^k/(1-(x^5^j)^5). (End)
|
|
EXAMPLE
|
a(10^3) = 13779.
a(10^4) = 397779.
a(10^5) = 11177779.
a(10^6) = 335777779.
|
|
MATHEMATICA
|
Select[Range[400], OddQ[Times@@IntegerDigits[#]] &] (* Alonso del Arte, Feb 21 2014 *)
|
|
PROG
|
(Magma) [ n : n in [1..129] | IsOdd(&*Intseq(n, 10)) ];
(Haskell)
a014261 n = a014261_list !! (n-1)
a014261_list = filter (all (`elem` "13579") . show) [1, 3..]
(PARI) a(n)={my(k=1); while(n>5^k, n-=5^k; k++); fromdigits([2*d+1 | d<-digits(5^k+n-1, 5)]) - 3*10^k} \\ Andrew Howroyd, Jan 17 2020
(Python)
from itertools import islice, count
def A014261(): return filter(lambda n: set(str(n)) <= {'1', '3', '5', '7', '9'}, count(1, 2))
(Python)
from itertools import count, islice, product
def agen(): yield from (int("".join(p)) for d in count(1) for p in product("13579", repeat=d))
|
|
CROSSREFS
|
Similar to but different from A066640.
Subsequence of A059708. Cf. A005408, A010879, A014263, A046034, A084545, A089581, A084984, A001743, A001744, A202267, A202268, A196564.
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|