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 44 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

A287170 a(n) = number of runs of consecutive prime numbers among the prime divisors of n.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jun 04 2017

Keywords

Comments

a(n) = 0 iff n = 1.
a(n) = 1 iff n belongs to A073491.
a(p) = 1 for any prime p.
a(A002110(n)) = 1 for any n > 0.
a(n!) = 1 for any n > 1.
a(A066205(n)) = n for any n > 0.
a(n) = a(A007947(n)) for any n > 0.
a(n) = a(A003961(n)) for any n > 0.
a(n*m) <= a(n) + a(m) for any n > 0 and m > 0.
Each number n can be uniquely represented as a product of a(n) distinct terms from A073491; this representation is minimal relative to the number of terms.

Examples

			See illustration of the first terms in the Links section.
The prime indices of 18564 are {1,1,2,4,6,7}, which separate into maximal gapless submultisets {1,1,2}, {4}, {6,7}, so a(18564) = 3; this corresponds to the ordered factorization 18564 = 12 * 7 * 221. - _Gus Wiseman_, Sep 03 2022
		

Crossrefs

Positions of first appearances are A066205.
These are the row-lengths of A356226 and A356234. Other statistics are:
- length: A287170 (this sequence)
- minimum: A356227
- maximum: A356228
- bisected length: A356229
- standard composition: A356230
- Heinz number: A356231
- positions of first appearances: A356603 or A356232 (sorted)
A001222 counts prime factors, distinct A001221.
A003963 multiplies together the prime indices.
A056239 adds up the prime indices, row sums of A112798.
A073491 lists numbers with gapless prime indices, complement A073492.

Programs

  • Mathematica
    Table[Length[Select[First/@If[n==1,{},FactorInteger[n]],!Divisible[n,NextPrime[#]]&]],{n,30}] (* Gus Wiseman, Sep 03 2022 *)
  • PARI
    a(n) = my (f=factor(n)); if (#f~==0, return (0), return (#f~ - sum(i=1, #f~-1, if (primepi(f[i,1])+1 == primepi(f[i+1,1]), 1, 0))))
    
  • Python
    from sympy import factorint, primepi
    def a087207(n):
        f=factorint(n)
        return sum([2**primepi(i - 1) for i in f])
    def a069010(n): return sum(1 for d in bin(n)[2:].split('0') if len(d)) # this function from Chai Wah Wu
    def a(n): return a069010(a087207(n)) # Indranil Ghosh, Jun 06 2017

Formula

a(n) = A069010(A087207(n))

A356224 Number of divisors of n whose prime indices cover an initial interval of positive integers.

Original entry on oeis.org

1, 2, 1, 3, 1, 3, 1, 4, 1, 2, 1, 5, 1, 2, 1, 5, 1, 4, 1, 3, 1, 2, 1, 7, 1, 2, 1, 3, 1, 4, 1, 6, 1, 2, 1, 7, 1, 2, 1, 4, 1, 3, 1, 3, 1, 2, 1, 9, 1, 2, 1, 3, 1, 5, 1, 4, 1, 2, 1, 7, 1, 2, 1, 7, 1, 3, 1, 3, 1, 2, 1, 10, 1, 2, 1, 3, 1, 3, 1, 5, 1, 2, 1, 5, 1, 2, 1
Offset: 1

Views

Author

Gus Wiseman, Aug 04 2022

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The a(n) gapless divisors of n = 1..24:
  1  2  1  4  1  6  1  8  1  2  1  12  1  2  1  16  1  18  1  4  1  2  1  24
     1     2     2     4     1     6      1     8      6      2     1     12
           1     1     2           4            4      2      1           8
                       1           2            2      1                  6
                                   1            1                         4
                                                                          2
                                                                          1
For example, the divisors of 12 are {1,2,3,4,6,12}, of which {1,2,4,6,12} belong to A055932, so a(12) = 5.
		

Crossrefs

These divisors belong to A055932, a subset of A073491 (complement A073492).
The complement is A356225.
A001223 lists the prime gaps.
A328338 has third-largest divisor prime.
A356226 gives the lengths of maximal gapless intervals of prime indices.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    normQ[m_]:=m=={}||Union[m]==Range[Max[m]];
    Table[Length[Select[Divisors[n],normQ[primeMS[#]]&]],{n,100}]

A107428 Number of gap-free compositions of n.

Original entry on oeis.org

1, 2, 4, 6, 11, 21, 39, 71, 141, 276, 542, 1070, 2110, 4189, 8351, 16618, 33134, 66129, 131937, 263483, 526453, 1051984, 2102582, 4203177, 8403116, 16800894, 33593742, 67174863, 134328816, 268624026, 537192064, 1074288649, 2148414285, 4296543181, 8592585289
Offset: 1

Views

Author

N. J. A. Sloane, May 26 2005

Keywords

Comments

A gap-free composition contains all the parts between its smallest and largest part. a(5)=11 because we have: 5, 3+2, 2+3, 2+2+1, 2+1+2, 1+2+2, 2+1+1+1, 1+2+1+1, 1+1+2+1, 1+1+1+2, 1+1+1+1+1. - Geoffrey Critzer, Apr 13 2014

Examples

			From _Gus Wiseman_, Oct 04 2022: (Start)
The a(0) = 1 through a(5) = 11 gap-free compositions:
  ()  (1)  (2)   (3)    (4)     (5)
           (11)  (12)   (22)    (23)
                 (21)   (112)   (32)
                 (111)  (121)   (122)
                        (211)   (212)
                        (1111)  (221)
                                (1112)
                                (1121)
                                (1211)
                                (2111)
                                (11111)
(End)
		

Crossrefs

The unordered version (partitions) is A034296, ranked by A073491.
The initial case is A107429, unordered A000009, ranked by A333217.
The unordered complement is counted by A239955, ranked by A073492.
These compositions are ranked by A356841.
The complement is counted by A356846, ranked by A356842
A356230 ranks gapless factorization lengths, firsts A356603.
A356233 counts factorizations into gapless numbers.

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, t!,
          `if`(i<1 or n add(b(n, i, 0), i=1..n):
    seq(a(n), n=1..40);  # Alois P. Heinz, Apr 14 2014
  • Mathematica
    Table[Length[Select[Level[Map[Permutations,IntegerPartitions[n]],{2}],Length[Union[#]]==Max[#]-Min[#]+1&]],{n,1,20}] (* Geoffrey Critzer, Apr 13 2014 *)
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, t!, If[i < 1 || n < i, 0, Sum[b[n - i*j, i - 1, t + j]/j!, {j, 1, n/i}]]]; a[n_] := Sum[b[n, i, 0], {i, 1, n}]; Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Aug 30 2016, after Alois P. Heinz *)

Formula

a(n) ~ 2^(n-2). - Alois P. Heinz, Dec 07 2014
G.f.: Sum_{j>0} Sum_{k>=j} C({j..k},x) where C({s},x) = Sum_{i in {s}} (C({s}-{i},x)*x^i)/(1 - Sum_{i in {s}} (x^i)) is the g.f. for compositions such that the set of parts equals {s} with C({},x) = 1. - John Tyler Rascoe, Jun 01 2024

Extensions

More terms from Vladeta Jovovic, May 26 2005

A356226 Irregular triangle giving the lengths of maximal gapless submultisets of the prime indices of n.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 3, 2, 1, 1, 1, 3, 1, 1, 1, 2, 4, 1, 3, 1, 2, 1, 1, 1, 1, 1, 1, 4, 2, 1, 1, 3, 2, 1, 1, 3, 1, 5, 1, 1, 1, 1, 2, 4, 1, 1, 1, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 3, 1, 1, 1, 5, 2, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 3, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 2, 1, 6
Offset: 1

Views

Author

Gus Wiseman, Aug 10 2022

Keywords

Comments

A sequence is gapless if it covers an unbroken interval of positive integers. For example, the multiset {2,3,5,5,6,9} has three maximal gapless submultisets: {2,3}, {5,5,6}, {9}.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			Triangle  begins: {}, {1}, {1}, {2}, {1}, {2}, {1}, {3}, {2}, {1,1}, {1}, {3}, {1}, {1,1}, {2}, {4}, {1}, {3}, {1}, {2,1}, ... For example, the prime indices of 20 are {1,1,3}, which separates into maximal gapless submultisets {{1,1},{3}}, so row 20 is (2,1).
The prime indices of 18564 are {1,1,2,4,6,7}, which separates into {1,1,2}, {4}, {6,7}, so row 18564 is (3,1,2). This corresponds to the factorization 18564 = 12 * 7 * 221.
		

Crossrefs

Row sums are A001222.
Singleton row positions are A073491, complement A073492.
Length-2,3,4 row positions are A073493-A073495.
Row lengths are A287170, firsts A066205.
Row minima are A356227.
Row maxima are A356228.
Bisected run-lengths are A356229.
Standard composition numbers of rows are A356230.
Heinz numbers of rows are A356231.
Positions of first appearances are A356232.
A001221 counts distinct prime factors, with sum A001414.
A001223 lists the prime gaps, reduced A028334.
A003963 multiplies together the prime indices of n.
A056239 adds up prime indices, row sums of A112798.
A132747 counts non-isolated divisors, complement A132881.
A356069 counts gapless divisors, initial A356224 (complement A356225).

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Length/@Split[primeMS[n],#1>=#2-1&],{n,100}]

A356225 Number of divisors of n whose prime indices do not cover an initial interval of positive integers.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 1, 0, 2, 2, 1, 1, 1, 2, 3, 0, 1, 2, 1, 3, 3, 2, 1, 1, 2, 2, 3, 3, 1, 4, 1, 0, 3, 2, 3, 2, 1, 2, 3, 4, 1, 5, 1, 3, 5, 2, 1, 1, 2, 4, 3, 3, 1, 3, 3, 4, 3, 2, 1, 5, 1, 2, 5, 0, 3, 5, 1, 3, 3, 6, 1, 2, 1, 2, 5, 3, 3, 5, 1, 5, 4, 2, 1, 7, 3, 2, 3
Offset: 1

Views

Author

Gus Wiseman, Aug 13 2022

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The a(70) = 6 divisors: 5, 7, 10, 14, 35, 70.
		

Crossrefs

These divisors belong to the complement of A055932, a subset of A073491.
These divisors belong to A080259, a superset of A073492.
The complement is counted by A356224.
A001223 lists the prime gaps.
A328338 has third-largest divisor prime, smallest A119313.
A356226 gives the lengths of maximal gapless intervals of prime indices.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    normQ[m_]:=m=={}||Union[m]==Range[Max[m]];
    Table[Length[Select[Divisors[n],!normQ[primeMS[#]]&]],{n,100}]

Formula

a(n) = A000005(n) - A356224(n).

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.

A239955 Number of partitions p of n such that (number of distinct parts of p) <= max(p) - min(p).

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 4, 7, 12, 17, 27, 38, 54, 75, 104, 137, 187, 245, 322, 418, 542, 691, 887, 1121, 1417, 1777, 2228, 2767, 3441, 4247, 5235, 6424, 7871, 9594, 11688, 14173, 17168, 20723, 24979, 30008, 36010, 43085, 51479, 61357, 73032, 86718, 102852, 121718
Offset: 0

Views

Author

Clark Kimberling, Mar 30 2014

Keywords

Comments

From Gus Wiseman, Jun 26 2022: (Start)
Also the number of partitions of n with at least one gap, i.e., partitions whose parts do not form a contiguous interval. These partitions are ranked by A073492. For example, the a(0) = 0 through a(8) = 12 partitions are:
. . . . (31) (41) (42) (52) (53)
(311) (51) (61) (62)
(411) (331) (71)
(3111) (421) (422)
(511) (431)
(4111) (521)
(31111) (611)
(3311)
(4211)
(5111)
(41111)
(311111)
Also the number of non-constant partitions of n with a repeated non-maximal part, ranked by A065201. The a(0) = 0 through a(8) = 12 partitions are:
. . . . (211) (311) (411) (322) (422)
(2111) (2211) (511) (611)
(3111) (3211) (3221)
(21111) (4111) (3311)
(22111) (4211)
(31111) (5111)
(211111) (22211)
(32111)
(41111)
(221111)
(311111)
(2111111)
(End)

Examples

			a(6) counts these 4 partitions:  51, 42, 411, 3111.
		

Crossrefs

The complement is counted by A034296 (strict A137793), ranked by A073491.
These partitions are ranked by A073492, conjugate A065201.
Applying the condition to the conjugate gives A350839, ranked by A350841.
A000041 counts integer partitions, strict A000009.
A090858 counts partitions with a single hole, ranked by A325284.
A116931 counts partitions with differences != -1, strict A003114.
A116932 counts partitions with differences != -1 or -2, strict A025157.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1,
          `if`(i<1, 0, add(b(n-i*j, i-1), j=1..n/i)))
        end:
    a:= n-> combinat[numbpart](n)-add(b(n, k), k=0..n):
    seq(a(n), n=0..47);  # Alois P. Heinz, Aug 18 2025
  • Mathematica
    z = 60; d[p_] := d[p] = Length[DeleteDuplicates[p]]; f[p_] := f[p] = Max[p] - Min[p]; g[n_] := g[n] = IntegerPartitions[n];
    Table[Count[g[n], p_ /; d[p] < f[p]], {n, 0, z}]  (*A239954*)
    Table[Count[g[n], p_ /; d[p] <= f[p]], {n, 0, z}] (*A239955*)
    Table[Count[g[n], p_ /; d[p] == f[p]], {n, 0, z}] (*A239956*)
    Table[Count[g[n], p_ /; d[p] > f[p]], {n, 0, z}]  (*A034296*)
    Table[Count[g[n], p_ /; d[p] >= f[p]], {n, 0, z}] (*A239958*)
    (* second program *)
    Table[Length[Select[IntegerPartitions[n],Min@@Differences[#]<-1&]],{n,0,30}] (* Gus Wiseman, Jun 26 2022 *)
  • PARI
    qs(a,q,n) = {prod(k=0,n,1-a*q^k)}
    A_q(N) = {if(N<4, vector(N+1,i,0), my(q='q+O('q^(N-2)), g= sum(i=2,N+1, q^i/qs(q,q,i-1)*sum(j=1,i-1, q^(2*j)*qs(q^2,q^2,j-2)))); concat([0,0,0,0], Vec(g)))} \\ John Tyler Rascoe, Aug 16 2025

Formula

a(n) = A000041(n) - A034296(n).
G.f.: Sum_{i>1} q^i/(q;q){i-1} * Sum{j=1..i-1} (q^2;q^2){j-2} where (a;q)_k = Product{i>=0..k} (1-a*q^i). - John Tyler Rascoe, Aug 16 2025

A356607 Number of strict integer partitions of n with at least one neighborless part.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 3, 4, 6, 6, 9, 11, 13, 17, 20, 24, 30, 36, 41, 52, 60, 71, 84, 100, 114, 137, 158, 183, 214, 248, 283, 330, 379, 432, 499, 570, 648, 742, 846, 955, 1092, 1234, 1395, 1580, 1786, 2005, 2270, 2548, 2861, 3216, 3610, 4032, 4526, 5055, 5642, 6304, 7031, 7820, 8720, 9694
Offset: 0

Views

Author

Gus Wiseman, Aug 26 2022

Keywords

Comments

A part x is neighborless if neither x - 1 nor x + 1 are parts.

Examples

			The a(0) = 0 through a(9) = 6 partitions:
  .  (1)  (2)  (3)  (4)   (5)   (6)   (7)    (8)    (9)
                    (31)  (41)  (42)  (52)   (53)   (63)
                                (51)  (61)   (62)   (72)
                                      (421)  (71)   (81)
                                             (431)  (531)
                                             (521)  (621)
		

Crossrefs

This is the strict case of A356235 and A356236.
The complement is counted by A356606, non-strict A355393 and A355394.
A000041 counts integer partitions, strict A000009.
A000837 counts relatively prime partitions, ranked by A289509.
A007690 counts partitions with no singletons, complement A183558.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],Function[ptn,UnsameQ@@ptn&&Or@@Table[!MemberQ[ptn,x-1]&&!MemberQ[ptn,x+1],{x,Union[ptn]}]]]],{n,0,30}]

Extensions

a(31)-a(59) from Lucas A. Brown, Sep 09 2022

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
Showing 1-10 of 44 results. Next