OFFSET
1,2
COMMENTS
Frequently, holes in a sequence are filled with zeros. This is a canonical way to do this and applied here to primes(A000040). A pre-scalar product when summation is omitted.
Equals row sums of triangle A143536. - Gary W. Adamson, Aug 23 2008
Mobius transform of sum of the distinct primes dividing n (A008472). - Steven Foster Clark, Jun 26 2020
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Prime zeta function.
FORMULA
Dirichlet generating function: primezeta(s-1). - Franklin T. Adams-Watters, Sep 11 2005
a(1)=0; for n>=1, a(n)=0, if either p_1|n or p_2|n or...or p_i|n, when n is in [p_i^2,p_(i+1)^2), i=1,2,..], where p_i is the i-th prime; otherwise a(n)=n. - Vladimir Shevelev, Apr 24 2010
a(n) = n*floor(gcd(((n-1)! + 1)/n,2)). - José de Jesús Camacho Medina, Apr 30 2016
a(n) = n*floor(1/A001065(n)); for n>1. - José de Jesús Camacho Medina, Aug 07 2016
G.f.: x*f'(x), where f(x) = Sum_{k>=1} x^prime(k). - Ilya Gutkovskiy, Apr 10 2017
a(n) = (2*n-1)! mod n^2, by Wilson's theorem. - Thomas Ordowski, Dec 27 2017
EXAMPLE
If 1<n<=8, a(n)=0 iff it is even on interval [4,9); if 9<=n<=25, then a(n)=0 iff n is either even or multiple of 3 on interval [9,25) etc. - Vladimir Shevelev, Apr 24 2010
MAPLE
seq(`if`(isprime(n), n, 0), n=1..100); # Robert Israel, May 02 2016
MATHEMATICA
If[PrimeQ@ #, #, 0] & /@ Range@ 94 (* or *)
Replace[#, n_ /; ! PrimeQ@ n -> 0] & /@ Range@ 94 (* Michael De Vlieger, May 02 2016 *)
Table[n*Floor[GCD[((n-1)! + 1)/n, 2]], {n, 2, 100}] (* José de Jesús Camacho Medina, Apr 30 2016 *)
PROG
(PARI) a(n)=if(isprime(n), n) \\ Charles R Greathouse IV, Oct 29 2011
(Haskell)
a061397 n = (fromIntegral $ a010051 n) * n -- Reinhard Zumkeller, Mar 21 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Labos Elemer, Jun 07 2001
STATUS
approved