OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..547
FORMULA
a(n) = Product_{k=1..n} dp_p(prime(k)) where prime(k)=A000040(k) and dp_p(m)=product of the nonzero digits of m in base p (p=10 for this sequence). - Hieronymus Fischer, Sep 29 2007
From Michel Marcus, Mar 11 2022: (Start)
a(n) = Product_{k=1..n} A051801(prime(k)).
a(n) = Product_{k=1..n} A101987(k). (End)
EXAMPLE
a(7) = dp_10(2)*dp_10(3)*dp_10(5)*dp_10(7)*dp_10(11)*dp_10(13)*dp_10(17) = 2*3*5*7*(1*1)*(1*3)*(1*7) = 4410.
MAPLE
a:= proc(n) option remember; `if`(n<1, 1, a(n-1)*mul(
`if`(i=0, 1, i), i=convert(ithprime(n), base, 10)))
end:
seq(a(n), n=1..30); # Alois P. Heinz, Mar 11 2022
MATHEMATICA
Rest[FoldList[Times, 1, Times@@Cases[IntegerDigits[#], Except[0]]&/@ Prime[ Range[ 20]]]] (* Harvey P. Dale, Mar 19 2013 *)
PROG
(PARI) f(n) = vecprod(select(x->(x>1), digits(prime(n)))); \\ A101987
a(n) = prod(k=1, n, f(k)); \\ Michel Marcus, Mar 11 2022
(Python)
from math import prod
from sympy import sieve
def pod(s): return prod(int(d) for d in s if d != '0')
def a(n): return pod("".join(str(sieve[i+1]) for i in range(n)))
print([a(n) for n in range(1, 23)]) # Michael S. Branicky, Mar 11 2022
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Alain Van Kerckhoven (alain(AT)avk.org), Sep 12 2007
EXTENSIONS
Corrected and extended by Hieronymus Fischer, Sep 29 2007
STATUS
approved