[go: up one dir, main page]

login
A101942
Write n in base 4 as n = b_0 + b_1*4 + b_2*4^2 + b_3*4^3 + ...; then a(n) = Product_{i >= 0} prime(i+1)^b_i.
3
1, 2, 4, 8, 3, 6, 12, 24, 9, 18, 36, 72, 27, 54, 108, 216, 5, 10, 20, 40, 15, 30, 60, 120, 45, 90, 180, 360, 135, 270, 540, 1080, 25, 50, 100, 200, 75, 150, 300, 600, 225, 450, 900, 1800, 675, 1350, 2700, 5400, 125, 250, 500, 1000, 375, 750, 1500, 3000, 1125
OFFSET
0,2
FORMULA
a(4^k) = prime(k+1).
EXAMPLE
a(13) = a(1 + 3*4) = 2^1 * 3^3 = 54.
a(29) = a(1 + 3*4 + 1*4^2) = 2^1 * 3^3 * 5^1 = 270.
MAPLE
a:= n-> (l-> mul(ithprime(i)^l[i], i=1..nops(l)))(convert(n, base, 4)):
seq(a(n), n=0..60); # Alois P. Heinz, Aug 31 2024
MATHEMATICA
f[n_Integer, base_Integer] /; base >= 2 := Product[ Prime[i]^IntegerDigits[n, base][[Length[IntegerDigits[n, base]] + 1 - i]], {i, Length[IntegerDigits[n, base]]}] Table[f[i, 4], {i, 0, 45}]
PROG
(PARI)
f(n, b) = { my(d = digits(n, b), L = #d); prod(i=1, L, prime(i)^d[L+1-i]) }
apply(n -> f(n, 4), [0..45]) \\ Satish Bysany, Mar 07 2017
CROSSREFS
Cf. A019565 (base 2), A101278 (base 3), A101943 (base 5), A054842 (base 10).
Sequence in context: A036118 A247555 A340730 * A344534 A050170 A087089
KEYWORD
base,nonn,easy
AUTHOR
Orges Leka (oleka(AT)students.uni-mainz.de), Dec 21 2004
STATUS
approved