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.

Showing 1-4 of 4 results.

A073491 Numbers having no prime gaps in their factorization.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 17, 18, 19, 23, 24, 25, 27, 29, 30, 31, 32, 35, 36, 37, 41, 43, 45, 47, 48, 49, 53, 54, 59, 60, 61, 64, 67, 71, 72, 73, 75, 77, 79, 81, 83, 89, 90, 96, 97, 101, 103, 105, 107, 108, 109, 113, 120, 121, 125, 127, 128, 131, 135
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 03 2002

Keywords

Comments

A073490(a(n)) = 0; subsequences are: A000040, A000961, A006094, A002110, A000142, A073485.
A137721(n) = number of terms not greater than n; A137794(a(n))=1; complement of A073492. - Reinhard Zumkeller, Feb 11 2008
Essentially the same as A066311. - R. J. Mathar, Sep 23 2008
The Heinz numbers of the partitions that have no gaps. The Heinz number of a partition p = [p_1, p_2, ..., p_r] is defined as Product_{j=1..r} (p_j-th prime) (concept used by Alois P. Heinz in A215366 as an "encoding" of a partition). Example: (i) 18 (= 2*3*3) is in the sequence because it is the Heinz number of the partition [1,2,2]; (ii) 10 (= 2*5) is not in the sequence because it is the Heinz number of the partition [1,3]. - Emeric Deutsch, Oct 02 2015

Examples

			360 is a term, as 360 = 2*2*2*3*3*5 with consecutive prime factors.
		

Crossrefs

Programs

  • Haskell
    a073491 n = a073491_list !! (n-1)
    a073491_list = filter ((== 0) . a073490) [1..]
    -- Reinhard Zumkeller, Dec 20 2013
    
  • Mathematica
    ok[n_] := (p = FactorInteger[n][[All, 1]]; PrimePi[Last@p] - PrimePi[First@p] == Length[p] - 1); Select[Range[135], ok] (* Jean-François Alcover, Apr 29 2011 *)
    npgQ[n_]:=Module[{f=Transpose[FactorInteger[n]][[1]]},f==Prime[Range[ PrimePi[ f[[1]]], PrimePi[f[[-1]]]]]]; Join[{1},Select[Range[2,200],npgQ]] (* Harvey P. Dale, Apr 12 2013 *)
  • PARI
    is(n)=my(f=factor(n)[,1]); for(i=2,#f,if(precprime(f[i]-1)>f[i-1], return(0))); 1 \\ Charles R Greathouse IV, Apr 28 2015

A073490 Number of prime gaps in factorization of n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 03 2002

Keywords

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<=kA137723(n)-1)=a(A137723(n)+n)=0. - Reinhard Zumkeller, Feb 09 2008

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.
		

Crossrefs

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) = A073484(A007947(n)).
a(A000040(n))=0; a(A000961(n))=0; a(A006094(n))=0; a(A002110(n))=0; a(A073485(n))=0.
a(A073486(n))>0; a(A073487(n)) = 1; a(A073488(n))=2; a(A073489(n))=3.
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

A137794 Characteristic function of numbers having no prime gaps in their factorization.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 11 2008

Keywords

Crossrefs

Cf. A137721 (partial sums).

Programs

  • Mathematica
    a[n_] := With[{pp = PrimePi @ FactorInteger[n][[All, 1]]},
         Boole[pp[[-1]] - pp[[1]] + 1 == Length[pp]]];
    Array[a, 105] (* Jean-François Alcover, Dec 09 2021 *)
  • PARI
    A137794(n) = if(1>=omega(n),1,my(pis=apply(primepi,factor(n)[,1])); for(k=2,#pis,if(pis[k]>(1+pis[k-1]),return(0))); (1)); \\ Antti Karttunen, Sep 27 2018

Formula

a(n) = 0^A073490(n).
a(A073491(n)) = 1; a(A073492(n)) = 0;
a(n) = A137721(n) - A137721(n-1) for n>1.

A137722 Number of numbers not greater than n with exactly one prime gap in their factorization.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, 7, 7, 8, 9, 9, 9, 9, 10, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 17, 18, 18, 18, 19, 20, 21, 22, 22, 22, 22, 23, 24, 24, 25, 26, 26, 27, 28, 29, 29, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 09 2008

Keywords

Comments

a(n) > a(n-1) iff A073490(n) = 1;
A137721(n) > a(n) for n < 134;
A137721(n) < a(n) for n > 140.

Crossrefs

Cf. A073493.
Showing 1-4 of 4 results.