A073490 Number of prime gaps in factorization of n.
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
Offset: 1
Examples
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.
Links
- R. Zumkeller, Table of n, a(n) for n = 1..50000
Programs
-
Haskell
a073490 1 = 0 a073490 n = length $ filter (> 1) $ zipWith (-) (tail ips) ips where ips = map a049084 $ a027748_row n -- Reinhard Zumkeller, Jul 04 2012
-
Maple
A073490 := proc(n) 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: seq(A073490(n),n=1..110) ; # R. J. Mathar, Oct 27 2019
-
Mathematica
gaps[n_Integer/;n>0]:=If[n===1, 0, Complement[Prime[PrimePi[Rest[ # ]]-1], # ]&[First/@FactorInteger[n]]]; Table[Length[gaps[n]], {n, 1, 120}] (* 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 *)
-
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:])) print([a(n) for n in range(1, 121)]) # Michael S. Branicky, Oct 14 2021
Formula
a(n)=0 iff A073483(n) = 1.
a(A097889(n)) = 0. - Reinhard Zumkeller, Nov 20 2004
0 <= a(m*n) <= a(m) + a(n) + 1. A137794(n) = 0^a(n). - Reinhard Zumkeller, Feb 11 2008
Extensions
More terms from Franklin T. Adams-Watters, May 19 2006
Comments