login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A192280
Characteristic function of numbers that are the product of consecutive primes.
9
1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0
OFFSET
1
COMMENTS
More exactly: characteristic function of squarefree numbers with no gaps in their prime factorization. - Antti Karttunen, Dec 15 2017
FORMULA
a(A073485(n)) = 1, a(A193166(n)) = 0.
MATHEMATICA
Array[Boole[Or[# == 1, PrimeQ[#], Union@ Differences@ PrimePi@ Flatten@ Map[ConstantArray[#1, #2] & @@ # &, FactorInteger[#] ] == {1} ] ] &, 105] (* Michael De Vlieger, Dec 16 2017 *)
PROG
(Haskell)
a192280 n = fromEnum $ a053590 n == n
a192280_list = map a192280 [1..]
-- Reinhard Zumkeller, May 28 2012, Aug 26 2011
(PARI) A192280(n) = { if(1==n, return(1)); if(!issquarefree(n), return(0)); my(ps=factor(n)[, 1], pis=vector(length(ps), i, primepi(ps[i])), diffsminusones = vector(length(pis)-1, i, (pis[i+1]-pis[i])-1)); !vecsum(diffsminusones); }; \\ Antti Karttunen, Dec 15 2017
CROSSREFS
Characteristic function of A073485.
Sequence in context: A361897 A189206 A323152 * A342005 A354355 A266974
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Aug 26 2011
STATUS
approved