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-7 of 7 results.

A096015 a(n) = A096014(n) / 2.

Original entry on oeis.org

1, 3, 3, 3, 5, 5, 7, 3, 3, 3, 11, 5, 13, 3, 3, 3, 17, 5, 19, 3, 3, 3, 23, 5, 5, 3, 3, 3, 29, 7, 31, 3, 3, 3, 5, 5, 37, 3, 3, 3, 41, 5, 43, 3, 3, 3, 47, 5, 7, 3, 3, 3, 53, 5, 5, 3, 3, 3, 59, 7, 61, 3, 3, 3, 5, 5, 67, 3, 3, 3, 71, 5, 73, 3, 3, 3, 7, 5, 79, 3, 3, 3, 83, 5, 5, 3, 3, 3, 89, 7, 7, 3, 3
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 15 2004

Keywords

Comments

For n > 1, a(n) is the larger of the least prime dividing n and the least prime not dividing n. - Peter Munn, Feb 21 2024

Crossrefs

Formula

a(n) = if n is odd then A020639(n) else A053669(n).

A053669 Smallest prime not dividing n.

Original entry on oeis.org

2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2
Offset: 1

Views

Author

Henry Bottomley, Feb 15 2000

Keywords

Comments

Smallest prime coprime to n.
Smallest k >= 2 coprime to n.
a(#(p-1)) = a(A034386(p-1)) = p is the first appearance of prime p in sequence.
a(A005408(n)) = 2; for n > 2: a(n) = A112484(n,1). - Reinhard Zumkeller, Sep 23 2011
Average value is 2.920050977316134... = A249270. - Charles R Greathouse IV, Nov 02 2013
Differs from A236454, "smallest number not dividing n^2", for the first time at n=210, where a(210)=11 while A236454(210)=8. A235921 lists all n for which a(n) differs from A236454. - Antti Karttunen, Jan 26 2014
For k >= 0, a(A002110(k)) is the first occurrence of p = prime(k+1). Thereafter p occurs whenever A007947(n) = A002110(k). Thus every prime appears in this sequence infinitely many times. - David James Sycamore, Dec 04 2024

Examples

			a(60) = 7, since all primes smaller than 7 divide 60 but 7 does not.
a(90) = a(120) = a(150) = a(180) = 7 because 90,120,150,180 all have same squarefree kernel = 30 = A002110(3), and 7 is the smallest prime which does not divide 30. - _David James Sycamore_, Dec 04 2024
		

Crossrefs

Programs

  • Haskell
    a053669 n = head $ dropWhile ((== 0) . (mod n)) a000040_list
    -- Reinhard Zumkeller, Nov 11 2012
    
  • Maple
    f:= proc(n) local p;
    p:= 2;
    while n mod p = 0 do p:= nextprime(p) od:
    p
    end proc:
    map(f, [$1..100]); # Robert Israel, May 18 2016
  • Mathematica
    Table[k := 1; While[Not[GCD[n, Prime[k]] == 1], k++ ]; Prime[k], {n, 1, 60}] (* Stefan Steinerberger, Apr 01 2006 *)
    With[{prs=Prime[Range[10]]},Flatten[Table[Select[prs,!Divisible[ n,#]&,1],{n,110}]]] (* Harvey P. Dale, May 03 2012 *)
  • PARI
    a(n)=forprime(p=2,,if(n%p,return(p))) \\ Charles R Greathouse IV, Nov 20 2012
    
  • Python
    from sympy import nextprime
    def a(n):
        p = 2
        while True:
            if n%p: return p
            else: p=nextprime(p) # Indranil Ghosh, May 12 2017
    
  • Python
    # using standard library functions only
    import math
    def a(n):
        k = 2
        while math.gcd(n,k) > 1: k += 1
        return k # Ely Golden, Nov 26 2020
  • Scheme
    (define (A053669 n) (let loop ((i 1)) (cond ((zero? (modulo n (A000040 i))) (loop (+ i 1))) (else (A000040 i))))) ;; Antti Karttunen, Jan 26 2014
    

Formula

a(n) = A071222(n-1)+1. [Because the right hand side computes the smallest k >= 2 such that gcd(n,k) = gcd(n-1,k-1) which is equal to the smallest k >= 2 coprime to n] - Antti Karttunen, Jan 26 2014
a(n) = 1 + Sum_{k=1..n}(floor((n^k)/k!)-floor(((n^k)-1)/k!)) = 2 + Sum_{k=1..n} A001223(k)*( floor(n/A002110(k))-floor((n-1)/A002110(k)) ). - Anthony Browne, May 11 2016
a(n!) = A151800(n). - Anthony Browne, May 11 2016
a(2k+1) = 2. - Bernard Schott, Jun 03 2019
Asymptotic mean: lim_{n->oo} (1/n) * Sum_{k=1..n} a(k) = A249270. - Amiram Eldar, Oct 29 2020
a(n) = A000040(A257993(n)) = A020639(A276086(n)) = A276086(n) / A324895(n). - Antti Karttunen, Apr 24 2022
a(n) << log n. For every e > 0, there is some N such that for all n > N, a(n) < (1 + e)*log n. - Charles R Greathouse IV, Dec 03 2022
A007947(n) = A002110(k) ==> a(n) = prime(k+1). - David James Sycamore, Dec 04 2024

Extensions

More terms from Andrew Gacek (andrew(AT)dgi.net), Feb 21 2000 and James Sellers, Feb 22 2000
Entry revised by David W. Wilson, Nov 25 2006

A272619 Irregular array read by rows: n-th row contains (in ascending order) the numbers 1 <= k < n such that at least one prime divisor p of k also divides n and at least one prime divisor q of k is coprime to n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 0, 10, 0, 6, 10, 12, 6, 10, 12, 6, 10, 12, 14, 0, 10, 14, 15, 0, 6, 12, 14, 15, 18, 6, 12, 14, 15, 18, 6, 10, 12, 14, 18, 20, 0, 10, 14, 15, 20, 21, 22, 10, 15, 20, 6, 10, 12, 14, 18, 20, 22, 24, 6, 12, 15, 18, 21, 24, 6, 10, 12, 18, 20, 21, 22, 24, 26, 0, 14, 21, 22
Offset: 1

Views

Author

Michael De Vlieger, May 03 2016

Keywords

Comments

The k are the "semitotatives" of n as counted by A243823(n).
All nonzero terms k are composite and pertain to composite rows n. This is because prime k must either divide or be coprime to n, and k = 1 is both a divisor of and coprime to n. Further, the terms k must have at least two distinct prime divisors p and q.
Row n for prime p contains zero, since numbers 1 <= k < p must either divide or be coprime to prime p.
Row n for prime powers p^e contains all the numbers k in the corresponding row of A133995. There is only one prime divisor p of p^e and every power 1 <= m <= e of p divides p^e, thus none of the terms of the corresponding row of A133995 are in A272618(n).
Rows n = 4 and 6 are special cases of composite n that contains zero. 4 is the smallest composite number; there are no composites k < n. 6 has the prime divisors 2 and 3, thus 5 is the smallest prime coprime to 6; the product of the minimum prime divisor and minimum prime coprime to 6 is 10, which exceeds 6 and falls outside the considered range. The situation is not so for composite n > 6. Thus rows n for composite n > 6 contain at least 1 nonzero value.
The smallest k of row n = A096014(n) < n, i.e., those values of A096014(n) pertaining to composite n > 6, a product of the smallest prime divisor p of n and the smallest prime q coprime to n. The smallest k of n are even squarefree semiprimes since 2 either divides n or is coprime to n and k is by definition a number with at least two distinct primes. The smallest k = 2p for p^2 sets record values for A096014(n) when we ignore values pertaining to prime n, n = 4, and n = 6.
In base n, 1/a(n) has a mixed recurrent expansion.

Examples

			For n = 12, the numbers 1 <= k < n such that the prime divisors p of k also divide n are {2, 3, 4, 6, 8, 9}; {2, 3, 4, 6} divide n = 12, thus row n = 12 is {8, 9}.
n:   k
1:   0
2:   0
3:   0
4:   0
5:   0
6:   0
7:   0
8:   6
9:   6
10:  6
11:  0
12: 10
13:  0
14:  6 10 12
15:  6 10 12
16:  6 10 12 14
17:  0
18: 10 14 15
19:  0
20:  6 12 14 15 18
		

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, pp. 144-5, Theorem 136.

Crossrefs

The union of nonzero terms of a(n) and A272618 = A133995, thus A243822(n) + A243823(n) = A045763(n).

Programs

  • Mathematica
    Table[With[{r = First /@ FactorInteger@ n}, Select[Range@ n, Function[m, And[! SubsetQ[r, First /@ FactorInteger@ m], 1 < GCD[m, n] < n]]]], {n, 30}] /. {} -> {0} // Flatten (* Michael De Vlieger, May 03 2016 *)

A160995 The smallest positive integer neither a divisor of n nor coprime to n.

Original entry on oeis.org

4, 6, 6, 10, 4, 14, 6, 6, 4, 22, 8, 26, 4, 6, 6, 34, 4, 38, 6, 6, 4, 46, 9, 10, 4, 6, 6, 58, 4, 62, 6, 6, 4, 10, 8, 74, 4, 6, 6, 82, 4, 86, 6, 6, 4, 94, 9, 14, 4, 6, 6, 106, 4, 10, 6, 6, 4, 118, 8, 122, 4, 6, 6, 10, 4, 134, 6, 6, 4, 142, 10, 146, 4, 6, 6, 14, 4, 158, 6, 6, 4, 166, 8, 10, 4, 6
Offset: 2

Views

Author

Leroy Quet, Jun 01 2009

Keywords

Comments

a(1) doesn't exist because 1 is coprime to all integers.
Terms are composite since primes either divide or are coprime to other numbers. - Michael De Vlieger, Feb 20 2025

Examples

			From _David James Sycamore_, Feb 28 2025: (Start)
Using my formula above: n = 4235 = 5*7*11^2, so a(n) = 2*5 = 10.
For n = odd prime p, a(n) = 2*p.
For n = 2, a(n) = min{2^2, 2*3} = 4.
For n = 4, a(n) = min{2^3, 2*3} = 6. (For all n = 2^k, k >= 2, a(n) = 6.)
For n = 120 = 2^3*3*5, a(n) = min{16, 9, 25, 14} = 9.
For n = 5040 = 2^4*3^2*5*7, a(n) = min{32, 27, 25, 49, 22} = 22.
For n = 3603600 = 2^4*3^2*5^2*7*11*13, a(n) = min{32,27,125,49,121,169,34} = 27. (End)
		

Crossrefs

Programs

  • Mathematica
    Table[k = 3; Until[1 < GCD[k, n] < k, k++]; k, {n, 2, 120}] (* Michael De Vlieger, Feb 20 2025 *)
  • PARI
    a(n)=for(k=4,2*n,if(gcd(n,k)>1 && n%k, return(k))) \\ Charles R Greathouse IV, Apr 05 2013
    
  • PARI
    a(n)=my(f=factor(n),b);forprime(p=2,,if(n%p,b=p*f[1,1];break));for(i=1,#f[,1],b=min(b,f[i,1]^(f[i,2]+1)));b \\ Charles R Greathouse IV, Apr 05 2013

Formula

For composite n > 4, a(n) is the first term of row n of A133995. - Michael De Vlieger, Feb 20 2025
For even n whose prime factorization is Product_{i=1..k} (p_i)^(e_i), a(n) = min({p_i^(e_i + 1) : i = 1..k} U {2*q}), where q = A053669(n); for odd n, a(n) = 2*A020639(n); see Example. - David James Sycamore, Feb 28 2025 [edited by Peter Munn, Jul 20 2025]
a(n) = min(A096014(n), A135718(n)). - Michael De Vlieger, Feb 24 2025

Extensions

Extended by Ray Chandler, Jun 13 2009

A330136 Numbers m such that 1 < gcd(m, 6) < m and m does not divide 6^e for e >= 0.

Original entry on oeis.org

10, 14, 15, 20, 21, 22, 26, 28, 30, 33, 34, 38, 39, 40, 42, 44, 45, 46, 50, 51, 52, 56, 57, 58, 60, 62, 63, 66, 68, 69, 70, 74, 75, 76, 78, 80, 82, 84, 86, 87, 88, 90, 92, 93, 94, 98, 99, 100, 102, 104, 105, 106, 110, 111, 112, 114, 116, 117, 118, 120, 122, 123
Offset: 1

Views

Author

Michael De Vlieger, Dec 02 2019

Keywords

Comments

Numbers m that are neither 3-smooth nor reduced residues mod 6. Such numbers m have at least 1 prime factor p <= 3 and at least 1 prime factor q > 3.
Complement of the union of A003586 and A007310. Analogous to A105115 for A120944(2) = 10. This sequence applies to A120944(1) = 6 = A002110(1).
The only composite n in A024619 for which n < A096014(n) is 6. Let n be a composite that is not a prime power (i.e., in A024619), let p = lpf(n) = A020639(n), and let q = A053669(n) be the smallest prime that does not divide n. We observe that A096014(n) = A020639(n) * A053669(n) = pq. Such n with n < pq must minimize one factor while maximizing the other. The prime p is minimum when n is even, and q is greatest when n is the product p_k# of the smallest k primes, i.e., when n is in A002110. Alternatively, q is minimum when n is odd, however, n > 2p since n is the product of at least two distinct odd primes. Since p_k# greatly increases as k increments, while A053669(p_k#) = p_(k + 1), and observing that A096014(30) = 2 * 7 = 14, the only composite n in A024619 such that n < pq is 6.

Examples

			All m < 10 are not in the sequence since they either divide 6^e with integer e >= 0 or are coprime to 6.
10 is in the sequence since gcd(6, 10) = 2 and 10 does not divide 6^e with integer e >= 0.
11 is not in the sequence since 11 is coprime to 6.
12 is not in the sequence since 12 | 6^2.
		

Crossrefs

Programs

  • Mathematica
    With[{nn = 123, k = 6}, Select[Range@ nn, And[1 < GCD[#, k] < #, PowerMod[k, Floor@ Log2@ nn, #] != 0] &]]

A291989 Smallest number that exceeds n and is divisible by at least one prime factor of n and by at least one prime that does not divide n.

Original entry on oeis.org

6, 6, 6, 10, 10, 14, 10, 12, 12, 22, 14, 26, 18, 18, 18, 34, 20, 38, 22, 24, 24, 46, 26, 30, 28, 30, 30, 58, 33, 62, 34, 36, 36, 40, 38, 74, 40, 42, 42, 82, 44, 86, 46, 48, 48, 94, 50, 56, 52, 54, 54, 106, 56, 60, 58, 60, 60, 118, 62, 122, 66, 66, 66, 70, 68
Offset: 2

Views

Author

Michael De Vlieger, Sep 20 2017

Keywords

Comments

Numbers m in A096014 are even squarefree semiprimes, i.e., the product of A020639(n) and A053669(n). Numbers k in a(n) are always even composite, but not always squarefree or semiprime. For prime p, A096014(p) = a(p).
Let b(n) = A272619(n), continued for k > n that are products of at least one prime p that divides n and at least one prime q that is coprime to n. The index of a(n) in b(n) is A243823(n) + 1, i.e., a(n) is the term that would follow the terms of A272619(n), greater than n.

Examples

			a(6) = A096014(6) = 10 since for 6, among the next composites {8, 9, 10, ...}, 10 is the first that is divisible by at least one prime p = 2 | 6, and at least one prime 5 that is coprime to 6. Since A020639(6) = 2 and A053669(6) = 5, a(6) and A096014(6) are identical.
a(12) = 14 since 14 is both the next composite after 12, and divisible by at least one prime divisor 2 of 12 and one prime q = 7 that is coprime to 12. This differs from A096014(12) = 10 because A053669(12) = 5, and 2 * 5 = 10.
		

Crossrefs

Programs

  • Mathematica
    Table[k = n + 2; While[Or[CoprimeQ[k, n], PowerMod[n, k, k] == 0], k++]; k, {n, 2, 66}] (* Michael De Vlieger, Sep 20 2017 *)

Formula

a(2) = 6; a(p) = A100484(pi(n)) for prime p > 2.
a(p) = A096014(p).

A382769 Largest k < n such that gcd(k,n) > 1 and rad(k) does not divide n, where rad = A007947, or 0 if k does not exist.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 10, 0, 12, 12, 0, 0, 15, 0, 18, 18, 20, 0, 22, 0, 24, 0, 26, 0, 28, 0, 0, 30, 30, 30, 34, 0, 36, 36, 38, 0, 40, 0, 42, 42, 44, 0, 46, 0, 48, 48, 50, 0, 52, 50, 54, 54, 56, 0, 58, 0, 60, 60, 0, 60, 63, 0, 66, 66, 68, 0, 70, 0, 72
Offset: 1

Views

Author

Michael De Vlieger, Apr 04 2025

Keywords

Crossrefs

Programs

  • Mathematica
    rad[x_] := rad[x] = Times @@ FactorInteger[x][[All, 1]]; {0}~Join~Table[If[Nor[PrimePowerQ[n], n == 6], k = n - 2; While[Or[CoprimeQ[n, k], Divisible[n, rad[k]]], k--]; k, 0], {n, 2, 120}]

Formula

a(n) = 0 for n = 6, and n in A000961.
For n > 6 in A024619, a(n) is the last term in row n of A272619.
Showing 1-7 of 7 results.