OFFSET
1,3
COMMENTS
This sequence is an analog of A156552 for the decimal base.
This sequence establishes a bijection between the positive numbers and the nonnegative numbers; see A290389 for the inverse sequence.
The number of runs of consecutive nonzero digits in the decimal representation of a(n) corresponds to the number of distinct prime factors of n.
a(A003961(n)) = 10 * a(n) for any n > 0.
a(n) = 0 mod 10 iff n is odd.
a(prime(n)^k) = A052382(k) * 10^(n-1) for any n > 0 and k > 0 (where prime(n) is the n-th prime).
a(prime(n)#) = Sum_{k=1..n} 100^(k-1) for any n > 0 (where prime#(n) = A002110(n)).
LINKS
EXAMPLE
For n = 5120 = 5^1 * 3^0 * 2^10:
- E_5120 = (1, 0, 10),
- F_5120 = ("1", "", "11"),
- a(5120) = 10011.
For n = 5040 = 7^1 * 5^1 * 3^2 * 2^4:
- E_5040 = (1, 1, 2, 4),
- F_5040 = ("1", "1", "2", "4"),
- a(5040) = 1010204.
MATHEMATICA
f[n_] := Function[m, Sum[(1 + Mod[Floor[(8 n + 1 - 9^m)/(8*9^j)], 9]) 10^j, {j, 0, m - 1}]]@ Floor@ Log[9, 8 n + 1]; Table[If[n == 1, 0, With[{s = FactorInteger[n] /. {p_, e_} /; p > 0 :> If[p > 1, PrimePi@ p -> f@ e]}, Function[t, FromDigits@ Flatten@ Reverse@ Riffle[#, ConstantArray[0, Length@ #]] &[ReplacePart[t, s] /. 0 -> {}]]@ConstantArray[0, Max[s[[All, 1]] ]]]], {n, 38}] (* Michael De Vlieger, Jul 31 2017 *)
PROG
(PARI) a(n) = {
my (f = factor(n), v = 0, nz = 0);
for (i=1, #f~,
my (x = A052382(f[i, 2]));
v += x * 10^(nz + prime pi(f[i, 1]) - 1);
nz += #digits(x);
);
return (v)
}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jul 27 2017
STATUS
approved