login
This site is supported by donations to The OEIS Foundation.

 

Logo


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. 14
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)

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

P. J. Grabner, A. Knopfmacher, Analysis of some new partition statistics, Ramanujan J., 12, 2006, 439-454.

Index entries for sequences related to primorial base

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[1]), ifactors(n)[2])[]})):

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.

One more than A276084.

Sequence in context: A228572 A078380 A062356 * A055881 A204917 A232098

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 19 17:48 EDT 2019. Contains 323395 sequences. (Running on oeis4.)