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-10 of 16 results. Next

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

A286470 a(n) = maximal gap between indices of successive primes in the prime factorization of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 3, 1, 0, 0, 1, 0, 2, 2, 4, 0, 1, 0, 5, 0, 3, 0, 1, 0, 0, 3, 6, 1, 1, 0, 7, 4, 2, 0, 2, 0, 4, 1, 8, 0, 1, 0, 2, 5, 5, 0, 1, 2, 3, 6, 9, 0, 1, 0, 10, 2, 0, 3, 3, 0, 6, 7, 2, 0, 1, 0, 11, 1, 7, 1, 4, 0, 2, 0, 12, 0, 2, 4, 13, 8, 4, 0, 1, 2, 8, 9, 14, 5, 1, 0, 3, 3, 2, 0, 5, 0, 5, 1, 15, 0, 1, 0, 2, 10, 3, 0, 6, 6, 9, 4, 16, 3, 1
Offset: 1

Views

Author

Antti Karttunen, May 13 2017

Keywords

Examples

			For n = 70 = 2*5*7 = prime(1)*prime(3)*prime(4), the largest index difference occurs between prime(1) and prime(3), thus a(70) = 3-1 = 2.
		

Crossrefs

Cf. A286469 (version which considers the index of the smallest prime as the initial gap).
Cf. A000961 (positions of zeros).
Differs from A242411 for the first time at n=70, where a(70) = 2, while A242411(70) = 1.

Programs

  • Mathematica
    Table[If[Or[n == 1, PrimeNu@ n == 1], 0, Max@ Differences@ PrimePi[FactorInteger[n][[All, 1]]]], {n, 120}] (* Michael De Vlieger, May 16 2017 *)
  • Python
    from sympy import primepi, isprime, primefactors, divisors
    def a049084(n): return primepi(n)*(1*isprime(n))
    def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
    def x(n): return 1 if n==1 else divisors(n)[-2]
    def a(n): return 0 if n==1 or len(primefactors(n))==1 else max(a055396(x(n)) - a055396(n), a(x(n))) # Indranil Ghosh, May 17 2017
  • Scheme
    (define (A286470 n) (cond ((or (= 1 n) (= 1 (A001221 n))) 0) (else (max (- (A055396 (A032742 n)) (A055396 n)) (A286470 (A032742 n))))))
    

Formula

a(1) = 0, for n > 1, if A001221(n) = 1 [when n is a prime power], a(n) = 0, otherwise a(n) = max((A055396(A032742(n))-A055396(n)), a(A032742(n))).
For all n >= 1, a(n) <= A243055(n).

Extensions

Definition corrected by Zak Seidov, May 16 2017

A073492 Numbers having at least one prime gap in their factorization.

Original entry on oeis.org

10, 14, 20, 21, 22, 26, 28, 33, 34, 38, 39, 40, 42, 44, 46, 50, 51, 52, 55, 56, 57, 58, 62, 63, 65, 66, 68, 69, 70, 74, 76, 78, 80, 82, 84, 85, 86, 87, 88, 91, 92, 93, 94, 95, 98, 99, 100, 102, 104, 106, 110, 111, 112, 114, 115, 116, 117, 118, 119, 122, 123, 124, 126
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 03 2002

Keywords

Comments

A073490(a(n)) > 0.
A137794(a(n))=0, complement of A073491. - Reinhard Zumkeller, Feb 11 2008

Crossrefs

Programs

  • Haskell
    a073492 n = a073492_list !! (n-1)
    a073492_list = filter ((> 0) . a073490) [1..]
    -- Reinhard Zumkeller, Dec 20 2013
  • Mathematica
    pa[n_, k_] := If[k == NextPrime[n], 0, 1]; Select[Range[126],Total[pa @@@ Partition[First /@ FactorInteger[#], 2, 1]] > 0 &] (* Jayanta Basu, Jul 01 2013 *)

A073493 Numbers having exactly one prime gap in their factorization.

Original entry on oeis.org

10, 14, 20, 21, 22, 26, 28, 33, 34, 38, 39, 40, 42, 44, 46, 50, 51, 52, 55, 56, 57, 58, 62, 63, 65, 66, 68, 69, 70, 74, 76, 78, 80, 82, 84, 85, 86, 87, 88, 91, 92, 93, 94, 95, 98, 99, 100, 102, 104, 106, 111, 112, 114, 115, 116, 117, 118, 119, 122, 123, 124, 126, 129
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 03 2002

Keywords

Examples

			200 is a term, as 200 = 2*2*2*5*5 with one gap between 2 and 5.
		

Crossrefs

Programs

  • Haskell
    a073493 n = a073493_list !! (n-1)
    a073493_list = filter ((== 1) . a073490) [1..]
    -- Reinhard Zumkeller, Dec 20 2013
    
  • Mathematica
    pa[n_, k_] := If[k == NextPrime[n], 0, 1]; Select[Range[130], Total[pa @@@ Partition[First /@ FactorInteger[#], 2, 1]] == 1 &] (* Jayanta Basu, Jul 01 2013 *)
  • Python
    from sympy import primefactors, nextprime
    def ok(n):
        pf = primefactors(n)
        return sum(p2 != nextprime(p1) for p1, p2 in zip(pf[:-1], pf[1:])) == 1
    print(list(filter(ok, range(1, 130)))) # Michael S. Branicky, Oct 14 2021

Formula

A073490(a(n)) = 1.

A073495 Numbers having exactly three prime gaps in their factorization.

Original entry on oeis.org

1870, 2090, 2470, 2530, 2990, 3190, 3410, 3458, 3740, 3770, 3910, 4030, 4070, 4180, 4186, 4510, 4730, 4810, 4930, 4940, 5060, 5170, 5187, 5270, 5278, 5330, 5474, 5510, 5590, 5642, 5830, 5890, 5980, 6110, 6279, 6290, 6380, 6490, 6710, 6734, 6820, 6890
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 03 2002

Keywords

Examples

			1870 is a term, as 1870 = 2*5*11*17 with three gaps: between 2 and 5, between 5 and 11 and between 11 and 17.
		

Crossrefs

Programs

  • Haskell
    a073495 n = a073495_list !! (n-1)
    a073495_list = filter ((== 3) . a073490) [1..]
    -- Reinhard Zumkeller, Dec 20 2013
  • Mathematica
    q[n_] := SequenceCount[FactorInteger[n][[;; , 1]], {p1_, p2_} /; p2 != NextPrime[p1], Overlaps -> True] == 3; Select[Range[7000], q] (* Amiram Eldar, Apr 10 2021*)

Formula

A073490(a(n)) = 3.

A097889 Numbers that are products of (at least two) consecutive primes.

Original entry on oeis.org

6, 15, 30, 35, 77, 105, 143, 210, 221, 323, 385, 437, 667, 899, 1001, 1147, 1155, 1517, 1763, 2021, 2310, 2431, 2491, 3127, 3599, 4087, 4199, 4757, 5005, 5183, 5767, 6557, 7387, 7429, 8633, 9797, 10403, 11021, 11663, 12317, 12673, 14351, 15015, 16637, 17017
Offset: 1

Views

Author

Bart la Bastide (bart(AT)xs4all.nl), Sep 21 2004

Keywords

Comments

Subsequence of A073485; A073490(a(n)) = 0. - Reinhard Zumkeller, Nov 20 2004
A proper subset of A073485. - Robert G. Wilson v, Jun 11 2010
A192280(a(n)) * (1 - A010051(a(n))) = 1. - Reinhard Zumkeller, Aug 26 2011 [corrected by Jason Yuen, Aug 29 2024]
The Heinz numbers of the partitions into at least 2 consecutive parts. The Heinz number of an integer partition p = [p_1, p_2, ..., p_r] is defined as Product(p_j-th prime, j=1...r) (concept used by Alois P. Heinz in A215366 as an "encoding" of a partition). Examples: (i) 105 (=3*5*7) is in the sequence because it is the Heinz number of the partition [2,3,4]; (ii) 108 (= 2*2*3*3*3) is not in the sequence because it is the Heinz number of the partition [1,1,2,2,2]. - Emeric Deutsch, Oct 02 2015

Examples

			1001 = 7 * 11 * 13.
		

Crossrefs

Cf. A050936.
Intersection of A073485 and A002808.

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a097889 n = a097889_list !! (n-1)
    a097889_list = f $ singleton (6, 2, 3) where
       f s = y : f (insert (w, p, q') $ insert (w `div` p, a151800 p, q') s')
             where w = y * q'; q' = a151800 q
                   ((y, p, q), s') = deleteFindMin s
    -- Reinhard Zumkeller, May 12 2015, Aug 26 2011
    
  • Maple
    isA097889 := proc(n)
        local plist,p,i ;
        plist := sort(convert(numtheory[factorset](n),list)) ;
        if nops(plist) < 2 then
            return false;
        end if;
        for i from 1 to nops(plist) do
            p := op(i,plist) ;
            if modp(n,p^2) = 0 then
                return false;
            end if;
            if i > 1 then
                if nextprime(op(i-1,plist)) <> p then
                    return false;
                end if;
            end if;
        end do:
        true;
    end proc:
    for n from 1 to 1000 do
        if isA097889(n) then
            printf("%d,",n);
        end if;
    end do: # R. J. Mathar, Jan 12 2016
  • Mathematica
    a = {}; Do[ AppendTo[a, Apply[ Times, (Prime /@ Partition[ Range[30], n, i]), 1]], {n, 2, 6}, {i, n - 1}]; Take[ Union[ Flatten[ a]], 45] (* Robert G. Wilson v, Sep 24 2004 *)
  • PARI
    list(lim)=my(v=List(), p, t); for(e=2, log(lim+.5)\log(2), p=1; t=prod(i=1, e-1, prime(i)); forprime(q=prime(e), lim, t*=q/p; if(t>lim, next(2)); listput(v, t); p=nextprime(p+1))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Oct 24 2012
    
  • Python
    import heapq
    from sympy import sieve
    sieve.extend(10**6)
    primes = list(sieve._list)
    def prime(n): return primes[n-1]
    def aupton(terms, verbose=False):
        p = prime(1)*prime(2); h = [(p, 1, 2)]; nextcount = 3; alst = []
        while len(alst) < terms:
            (v, s, l) = heapq.heappop(h)
            alst.append(v)
            if verbose: print(f"{v}, [= Prod_{{i = {s}..{l}}} prime(i)]")
            if v >= p:
                p *= prime(nextcount)
                heapq.heappush(h, (p, 1, nextcount))
                nextcount += 1
            v //= prime(s); s += 1; l += 1; v *= prime(l)
            heapq.heappush(h, (v, s, l))
        return alst
    print(aupton(45)) # Michael S. Branicky, Jun 15 2021

Formula

a(n) ~ n^2 log^2 n. - Charles R Greathouse IV, Oct 24 2012

Extensions

More terms from Robert G. Wilson v, Sep 24 2004
Data corrected for n > 41 by Reinhard Zumkeller, Aug 26 2011

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.

A286472 Compound filter (for counting prime gaps): a(1) = 1, a(n) = 2*A032742(n) + (1 if n is composite and spf(A032742(n)) > nextprime(spf(n)), and 0 otherwise). Here spf is the smallest prime factor, A020639.

Original entry on oeis.org

1, 2, 2, 4, 2, 6, 2, 8, 6, 11, 2, 12, 2, 15, 10, 16, 2, 18, 2, 20, 15, 23, 2, 24, 10, 27, 18, 28, 2, 30, 2, 32, 23, 35, 14, 36, 2, 39, 27, 40, 2, 42, 2, 44, 30, 47, 2, 48, 14, 51, 35, 52, 2, 54, 23, 56, 39, 59, 2, 60, 2, 63, 42, 64, 27, 66, 2, 68, 47, 71, 2, 72, 2, 75, 50, 76, 22, 78, 2
Offset: 1

Views

Author

Antti Karttunen, May 11 2017

Keywords

Comments

For n > 1, a(n) is odd if and only if n is a composite with its smallest prime factor occurring only once and with a gap of at least one between the smallest and the next smallest prime factor.
For all i, j: a(i) = a(j) => A073490(i) = A073490(j). This follows because A073490(n) can be computed by recursively invoking a(n), without needing any other information.

Examples

			For n = 4 = 2*2, the two smallest prime factors (taken with multiplicity) are 2 and 2, and the difference between their indices is 0, thus a(4) = 2*A032742(4) + 0 = 2*(4/2) + 0 = 2.
For n = 6 = 2*3 = prime(1)*prime(2), the difference between the indices of two smallest prime factors is 1 (which is less than required 2), thus a(6) = 2*A032742(6) + 0 = 2*(6/2) + 0 = 6.
For n = 10 = 2*5 = prime(1)*prime(3), the difference between the indices of two smallest prime factors is 2, thus a(10) = 2*A032742(10) + 1 = 2*(10/2) + 1 = 11.
		

Crossrefs

Cf. A000040 (primes give the positions of 2's).
Cf. A073490 (one of the matched sequences).

Programs

  • Mathematica
    Table[Function[{p, d}, 2 d + If[And[CompositeQ@ n, FactorInteger[d][[1, 1]] > NextPrime[p]], 1, 0] - Boole[n == 1]] @@ {#, n/#} &@ FactorInteger[n][[1, 1]], {n, 98}] (* Michael De Vlieger, May 12 2017 *)
  • Python
    from sympy import primefactors, divisors, nextprime
    def ok(n): return 1 if isprime(n)==0 and min(primefactors(divisors(n)[-2])) > nextprime(min(primefactors(n))) else 0
    def a(n): return 1 if n==1 else 2*divisors(n)[-2] + ok(n) # Indranil Ghosh, May 12 2017
  • Scheme
    (define (A286472 n) (if (= 1 n) n (+ (* 2 (A032742 n)) (if (> (A286471 n) 2) 1 0))))
    

Formula

a(n) = 2*A032742(n) + [A286471(n) > 2], a(1) = 1.

A073494 Numbers having exactly two prime gaps in their factorization.

Original entry on oeis.org

110, 130, 170, 182, 190, 220, 230, 238, 260, 266, 273, 290, 310, 322, 340, 357, 364, 370, 374, 380, 399, 406, 410, 418, 430, 434, 440, 460, 470, 476, 483, 494, 506, 518, 520, 530, 532, 546, 550, 561, 574, 580, 590, 598, 602, 609, 610, 620, 627, 638, 644
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 03 2002

Keywords

Comments

A073490(a(n)) = 2.

Examples

			220 is a term, as 220 = 2*2*5*11 with two gaps: between 2 and 5 and between 5 and 11.
		

Crossrefs

Programs

  • Haskell
    a073494 n = a073494_list !! (n-1)
    a073494_list = filter ((== 2) . a073490) [1..]
    -- Reinhard Zumkeller, Dec 20 2013
  • Mathematica
    pa[n_, k_] := If[k == NextPrime[n], 0, 1]; Select[Range[645], Total[pa @@@ Partition[First /@ FactorInteger[#], 2, 1]] == 2 &] (* Jayanta Basu, Jul 01 2013 *)

A137721 Number of numbers not greater than n with no prime gaps in their factorization.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, 17, 17, 17, 18, 19, 20, 20, 21, 21, 22, 23, 24, 25, 25, 25, 26, 27, 28, 28, 28, 28, 29, 29, 30, 30, 31, 31, 32, 33, 34, 34, 34, 34, 35, 36, 36, 36, 36, 36, 37, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 41, 42, 43, 44
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 09 2008

Keywords

Comments

a(n) > a(n-1) iff A073490(n) = 0;
a(n) > A137722(n) for n < 134;
a(n) < A137722(n) for n > 140;
a(A137723(n) + n) = a(A137723(n)) + 1.
Partial sums of A137794. - Reinhard Zumkeller, Feb 11 2008

Crossrefs

Programs

  • Mathematica
    b[n_] := With[{pp = PrimePi @ FactorInteger[ n ][[All, 1]]},
         Boole[pp[[-1]] - pp[[1]] + 1 == Length[pp]]]; (* b is A137794 *)
    Array[b, 105] // Accumulate (* Jean-François Alcover, Dec 09 2021 *)

Formula

a(n) = Sum_{k=1..n} 0^A073490(k).
Showing 1-10 of 16 results. Next