cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A073490 Number of prime gaps in factorization of n.

This page as a plain text file.
%I A073490 #33 Aug 11 2025 09:02:12
%S A073490 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,
%T A073490 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,
%U A073490 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
%N A073490 Number of prime gaps in factorization of n.
%C A073490 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
%H A073490 R. Zumkeller, <a href="/A073490/b073490.txt">Table of n, a(n) for n = 1..50000</a>
%F A073490 a(n) = A073484(A007947(n)).
%F A073490 a(A000040(n))=0; a(A000961(n))=0; a(A006094(n))=0; a(A002110(n))=0; a(A073485(n))=0.
%F A073490 a(A073486(n))>0; a(A073487(n)) = 1; a(A073488(n))=2; a(A073489(n))=3.
%F A073490 a(n)=0 iff A073483(n) = 1.
%F A073490 a(A097889(n)) = 0. - _Reinhard Zumkeller_, Nov 20 2004
%F A073490 0 <= a(m*n) <= a(m) + a(n) + 1. A137794(n) = 0^a(n). - _Reinhard Zumkeller_, Feb 11 2008
%e A073490 84 = 2*2*3*7 with one gap between 3 and 7, therefore a(84) = 1;
%e A073490 110 = 2*5*11 with two gaps: between 2 and 5 and between 5 and 11, therefore a(110) = 2.
%p A073490 A073490 := proc(n)
%p A073490     local a,plist ;
%p A073490     plist := sort(convert(numtheory[factorset](n),list)) ;
%p A073490     a := 0 ;
%p A073490     for i from 2 to nops(plist) do
%p A073490         if op(i,plist) <> nextprime(op(i-1,plist)) then
%p A073490             a := a+1 ;
%p A073490         end if;
%p A073490     end do:
%p A073490     a;
%p A073490 end proc:
%p A073490 seq(A073490(n),n=1..110) ; # _R. J. Mathar_, Oct 27 2019
%t A073490 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 *)
%t A073490 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 *)
%o A073490 (Haskell)
%o A073490 a073490 1 = 0
%o A073490 a073490 n = length $ filter (> 1) $ zipWith (-) (tail ips) ips
%o A073490    where ips = map a049084 $ a027748_row n
%o A073490 -- _Reinhard Zumkeller_, Jul 04 2012
%o A073490 (Python)
%o A073490 from sympy import primefactors, nextprime
%o A073490 def a(n):
%o A073490     pf = primefactors(n)
%o A073490     return sum(p2 != nextprime(p1) for p1, p2 in zip(pf[:-1], pf[1:]))
%o A073490 print([a(n) for n in range(1, 121)]) # _Michael S. Branicky_, Oct 14 2021
%Y A073490 Cf. A073491, A073492, A073493, A073494, A073495.
%Y A073490 Cf. A137721, A137722, A027748, A049084.
%K A073490 nonn,nice
%O A073490 1,110
%A A073490 _Reinhard Zumkeller_, Aug 03 2002
%E A073490 More terms from _Franklin T. Adams-Watters_, May 19 2006