The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A257993 Least gap in the partition having Heinz number n; index of the least prime not dividing n. 47
 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS The "least gap" of a partition is the least positive integer that is not a part of the partition. For example, the least gap of the partition [7,4,2,2,1] is 3. We define the Heinz number of a partition p = [p_1, p_2, ..., p_r] as Product(p_j-th prime, j=1...r) (concept used by Alois P. Heinz in A215366 as an "encoding" of a partition). For example, for the partition [1, 1, 2, 4, 10] we get 2*2*3*7*29 = 2436. In the Maple program the subprogram B yields the partition with Heinz number n. Sum of least gaps of all partitions of m = A022567(m). From Antti Karttunen, Aug 22 2016: (Start) Index of the least prime not dividing n. (After a formula given by Heinz.) Least k such that A002110(k) does not divide n. One more than the number of trailing zeros in primorial base representation of n, A049345. (End) The least gap is also called the mex (minimal excludant) of the partition. - Gus Wiseman, Apr 20 2021 REFERENCES G. E. Andrews, K. Eriksson, Integer Partitions, Cambridge Univ. Press, 2004, Cambridge. M. Bona, A Walk Through Combinatorics, World Scientific Publishing Co., 2002. LINKS Alois P. Heinz, Table of n, a(n) for n = 1..20000 George E. Andrews and David Newman, Partitions and the Minimal Excludant, Annals of Combinatorics, Volume 23, May 2019, Pages 249-254. P. J. Grabner, A. Knopfmacher, Analysis of some new partition statistics, Ramanujan J., 12, 2006, 439-454. Brian Hopkins, James A. Sellers, and Dennis Stanton, Dyson's Crank and the Mex of Integer Partitions, arXiv:2009.10873 [math.CO], 2020. Wikipedia, Mex (mathematics) FORMULA a(n) = A000720(A053669(n)). - Alois P. Heinz, May 18 2015 From Antti Karttunen, Aug 22-30 2016: (Start) a(n) = 1 + A276084(n). a(n) = A055396(A276086(n)). A276152(n) = A002110(a(n)). (End) EXAMPLE a(18) = 3 because the partition having Heinz number 18 = 2*3*3 is [1,2,2], having least gap equal to 3. MAPLE with(numtheory): a := proc (n) local B, q: B := proc (n) local nn, j, m: nn := op(2, ifactors(n)): for j to nops(nn) do m[j] := op(j, nn) end do: [seq(seq(pi(op(1, m[i])), q = 1 .. op(2, m[i])), i = 1 .. nops(nn))] end proc: for q while member(q, B(n)) = true do  end do: q end proc: seq(a(n), n = 1 .. 150); # second Maple program: a:= n-> `if`(n=1, 1, (s-> min({\$1..(max(s)+1)} minus s))(         {map(x-> numtheory[pi](x), ifactors(n))[]})): seq(a(n), n=1..100);  # Alois P. Heinz, May 09 2016 # faster: A257993 := proc(n) local p, c; c := 1; p := 2; while n mod p = 0 do p := nextprime(p); c := c + 1 od: c end: seq(A257993(n), n=1..100); # Peter Luschny, Jun 04 2017 MATHEMATICA A053669[n_] := For[p = 2, True, p = NextPrime[p], If[CoprimeQ[p, n], Return[p]]]; a[n_] := PrimePi[A053669[n]]; Array[a, 100] (* Jean-François Alcover, Nov 28 2016 *) Table[k = 1; While[! CoprimeQ[Prime@ k, n], k++]; k, {n, 100}] (* Michael De Vlieger, Jun 22 2017 *) PROG (Scheme) (define (A257993 n) (let loop ((n n) (i 1)) (let* ((p (A000040 i)) (d (modulo n p))) (if (not (zero? d)) i (loop (/ (- n d) p) (+ 1 i)))))) ;; Antti Karttunen, Aug 22 2016 (Python) from sympy import nextprime, primepi def a053669(n):     p = 2     while True:         if n%p!=0: return p         else: p=nextprime(p) def a(n): return primepi(a053669(n)) # Indranil Ghosh, May 12 2017 (PARI) a(n) = forprime(p=2, , if (n % p, return(primepi(p)))); \\ Michel Marcus, Jun 22 2017 CROSSREFS Cf. A215366, A002110, A022567, A049345, A053669, A055396, A276086, A276094, A276152. Positions of 1's are A005408. Positions of 2's are A047235. The number of gaps is A079067. The version for crank is A257989. The triangle counting partitions by this statistic is A264401. One more than A276084. The version for greatest difference is A286469 or A286470. A maximal instead of minimal version is A339662. Positions of even terms are A342050. Positions of odd terms are A342051. A000070 counts partitions with a selected part. A006128 counts partitions with a selected position. A056239 adds up prime indices, row sums of A112798. A073491 lists numbers with gap-free prime indices. A238709 counts partitions by sum and least difference. A333214 lists positions of adjacent unequal prime gaps. A339737 counts partitions by sum and greatest gap. Cf. A001223, A001511, A005117, A026794, A029707, A072233, A079068, A098743, A124010, A279945, A325351, A325352. Sequence in context: A334675 A078380 A062356 * A055881 A332202 A204917 Adjacent sequences:  A257990 A257991 A257992 * A257994 A257995 A257996 KEYWORD nonn AUTHOR Emeric Deutsch, May 18 2015 EXTENSIONS A simpler description added to the name by Antti Karttunen, Aug 22 2016 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified May 12 06:54 EDT 2021. Contains 343820 sequences. (Running on oeis4.)