|
|
A073490
|
|
Number of prime gaps in factorization of n.
|
|
17
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 2, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,110
|
|
COMMENTS
|
A137723(n) is the smallest number of the first occurring set of exactly n consecutive numbers with at least one prime gap in their factorization: a(A137723(n)+k)>0 for 0<=k<n and a(A137723(n)-1)=a(A137723(n)+n)=0. - Reinhard Zumkeller, Feb 09 2008
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
84 = 2*2*3*7 with one gap between 3 and 7, therefore a(84) = 1;
110 = 2*5*11 with two gaps: between 2 and 5 and between 5 and 11, therefore a(110) = 2.
|
|
MAPLE
|
local a, plist ;
plist := sort(convert(numtheory[factorset](n), list)) ;
a := 0 ;
for i from 2 to nops(plist) do
if op(i, plist) <> nextprime(op(i-1, plist)) then
a := a+1 ;
end if;
end do:
a;
end proc:
|
|
MATHEMATICA
|
gaps[n_Integer/; n>0]:=If[n===1, 0, Complement[Prime[PrimePi[Rest[ # ]]-1], # ]&[First/@FactorInteger[n]]]; Table[Length[gaps[n]], {n, 1, 105}] (Wouter Meeussen, Oct 30 2004)
pa[n_, k_] := If[k == NextPrime[n], 0, 1]; Table[Total[pa @@@ Partition[First /@ FactorInteger[n], 2, 1]], {n, 120}] (* Jayanta Basu, Jul 01 2013 *)
|
|
PROG
|
(Haskell)
a073490 1 = 0
a073490 n = length $ filter (> 1) $ zipWith (-) (tail ips) ips
where ips = map a049084 $ a027748_row n
(Python)
from sympy import primefactors, nextprime
def a(n):
pf = primefactors(n)
return sum(p2 != nextprime(p1) for p1, p2 in zip(pf[:-1], pf[1:]))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|