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 38 results. Next

A161849 a(n) = A052369(n) mod A056608(n).

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Jun 20 2009

Keywords

Comments

(Largest prime divisor) modulo (smallest prime divisor) of n-th composite number.

Examples

			a(1) = 0 = 2 mod 2;
a(2) = 1 = 3 mod 2;
a(3) = 0 = 2 mod 2;
a(4) = 0 = 3 mod 3;
a(5) = 1 = 5 mod 2.
		

Crossrefs

Programs

  • Magma
    [ D[ #D] mod D[1]: n in [2..140] | not IsPrime(n) where D is PrimeDivisors(n) ]; // Klaus Brockhaus, Jun 24 2009
  • Maple
    A002808 := proc(n) option remember; local a; if n = 1 then 4; else for a from procname(n-1)+1 do if not isprime(a) then RETURN(a) : fi; od: fi; end:
    A006530 := proc(n) local u: if n=1 then 1 else u:= numtheory[factorset](n): max(seq(u[j], j=1..nops(u))) end if end:
    A020639 := proc(n) local u: if n=1 then 1 else u:= numtheory[factorset](n): min(seq(u[j], j=1..nops(u))) end if end:
    A052369 := proc(n) A006530(A002808(n)) ; end:
    A056608 := proc(n) A020639(A002808(n)) ; end:
    A161849 := proc(n) A052369(n) mod A056608(n) ; end: seq(A161849(n),n=1..120) ; # R. J. Mathar, Jun 23 2009
  • Mathematica
    Composite[n_] := FixedPoint[n + PrimePi[#] + 1&, n + PrimePi[n] + 1];
    a[n_] := With[{f = FactorInteger[Composite[n]]}, f[[-1, 1]]~Mod~f[[1, 1]]];
    Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Oct 15 2023 *)

Extensions

a(102) corrected by R. J. Mathar, Jun 23 2009

A091114 Number of partitions of n-th composite number containing the smallest prime factor: a(n) = A027293(A002808(n), A056608(n)).

Original entry on oeis.org

2, 5, 11, 11, 22, 42, 77, 77, 135, 231, 385, 385, 627, 1002, 627, 1575, 1575, 2436, 3718, 5604, 5604, 8349, 5604, 12310, 17977, 17977, 26015, 37338, 53174, 53174, 75175, 105558, 53174, 147273, 147273, 204226, 281589, 204226, 386155, 386155
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 22 2004

Keywords

Comments

a(n) = A000041(A002808(n)) - A091094(n).
a(n) = A000041(A085271(n)). - Charlie Neder, Jan 10 2019

Examples

			n=2: A002808(2)=6=2*3 has A000041(6)=11 partitions: 6 = 5+1 = 4+2 = 4+1+1 = 3+3 = 3+2+1 = 3+1+1+1 = 2+2+2 = 2+2+1+1 = 2+1+1+1+1 = 1+1+1+1+1+1, 2 occurs in 5 partitions, therefore a(2)=5.
		

Crossrefs

Programs

  • PARI
    lista(nn) = forcomposite(n=2, nn, print1(numbpart(n - divisors(n)[2]), ", ")); \\ Michel Marcus, Jan 11 2019

A091109 Number of occurrences of smallest prime factor in all partitions of n-th composite number: a(n)=A066633(A002808(n), A056608(n)).

Original entry on oeis.org

3, 8, 19, 15, 41, 83, 160, 122, 295, 526, 911, 683, 1538, 2540, 853, 4115, 3050, 6551, 10269, 15873, 11664, 24222, 8415, 36532, 54509, 39784, 80524, 117862, 171036, 124143, 246211, 351769, 72718, 499042, 360550, 703268, 984857, 353996
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 22 2004

Keywords

Examples

			n=2: A002808(2)=6=2*3 has A000041(6)=11 partitions: 6 = 5+1 = 4+2 = 4+1+1 = 3+3 = 3+2+1 = 3+1+1+1 = 2+2+2 = 2+2+1+1 = 2+1+1+1+1 = 1+1+1+1+1+1, 2 occurs 8 times, therefore a(2)=8.
		

Crossrefs

Programs

  • Mathematica
    Count[Flatten[IntegerPartitions[#]],FactorInteger[#][[1,1]]]&/@ Select[ Range[ 60],CompositeQ] (* Harvey P. Dale, Sep 08 2018 *)

A002808 The composite numbers: numbers n of the form x*y for x > 1 and y > 1.

Original entry on oeis.org

4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88
Offset: 1

Views

Author

Keywords

Comments

The natural numbers 1,2,... are divided into three sets: 1 (the unit), the primes (A000040) and the composite numbers (A002808).
The number of composite numbers <= n (A065855) = n - pi(n) (A000720) - 1.
n is composite iff sigma(n) + phi(n) > 2n. This is a nice result of the well known theorem: For all positive integers n, n = Sum_{d|n} phi(d). For the proof see my contribution to puzzle 76 of Carlos Rivera's Primepuzzles. - Farideh Firoozbakht, Jan 27 2005, Jan 18 2015
The composite numbers have the semiprimes A001358 as primitive elements.
A211110(a(n)) > 1. - Reinhard Zumkeller, Apr 02 2012
A060448(a(n)) > 1. - Reinhard Zumkeller, Apr 05 2012
A086971(a(n)) > 0. - Reinhard Zumkeller, Dec 14 2012
Composite numbers n which are the product of r=A001222(n) prime numbers are sometimes called r-almost primes. Sequences listing r-almost primes are: A000040 (r = 1), A001358 (r = 2), A014612 (r = 3), A014613 (r = 4), A014614 (r = 5), A046306 (r = 6), A046308 (r = 7), A046310 (r = 8), A046312 (r = 9), A046314 (r = 10), A069272 (r = 11), A069273 (r = 12), A069274 (r = 13), A069275 (r = 14), A069276 (r = 15), A069277 (r = 16), A069278 (r = 17), A069279 (r = 18), A069280 (r = 19), A069281 (r = 20). - Jason Kimberley, Oct 02 2011
a(n) = A056608(n) * A160180(n). - Reinhard Zumkeller, Mar 29 2014
Degrees for which there are irreducible polynomials which are reducible mod p for all primes p, see Brandl. - Charles R Greathouse IV, Sep 04 2014
An integer is composite if and only if it is the sum of strictly positive integers in arithmetic progression with common difference 2: 4 = 1 + 3, 6 = 2 + 4, 8 = 3 + 5, 9 = 1 + 3 + 5, etc. - Jean-Christophe Hervé, Oct 02 2014
This statement holds since k+(k+2)+...+k+2(n-1) = n*(n+k-1) = a*b with arbitrary a,b (taking n=a and k=b-a+1 if b>=a). - M. F. Hasler, Oct 04 2014
For n > 4, these are numbers n such that n!/n^2 = (n-1)!/n is an integer (see A056653). - Derek Orr, Apr 16 2015
Let f(x) = Sum_{i=1..x} Sum_{j=2..i-1} cos((2*Pi*x*j)/i). It is known that the zeros of f(x) are the prime numbers. So these are the numbers n such that f(n) > 0. - Michel Lagneau, Oct 13 2015
Numbers n that can be written as solutions of the Diophantine equation n = (x+2)(y+2) where {x,y} in N^2, pairs of natural numbers including zero (cf. Mathematica code and Davis). - Ron R Spencer and Bradley Klee, Aug 15 2016
Numbers n with a partition (containing at least two summands) so that its summands also multiply to n. If n is prime, there is no way to find those two (or more) summands. If n is composite, simply take a factor or several, write those divisors and fill with enough 1's so that they add up to n. For example: 4 = 2*2 = 2+2, 6 = 1*2*3 = 1+2+3, 8 = 1*1*2*4 = 1+1+2+4, 9 = 1*1*1*3*3 = 1+1+1+3+3. - Juhani Heino, Aug 02 2017

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 2.
  • A. E. Bojarincev, Asymptotic expressions for the n-th composite number, Univ. Mat. Zap. 6:21-43 (1967). - In Russian.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 127.
  • Martin Davis, "Algorithms, Equations, and Logic", pp. 4-15 of S. Barry Cooper and Andrew Hodges, Eds., "The Once and Future Turing: Computing the World", Cambridge 2016.
  • R. K. Guy, Unsolved Problems Number Theory, Section A.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 2.
  • D. R. Hofstadter, Goedel, Escher, Bach: an Eternal Golden Braid, Random House, 1980, p. 66.
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 51.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Complement of A008578. - Omar E. Pol, Dec 16 2016
Cf. A073783 (first differences), A073445 (second differences).
Boustrophedon transforms: A230954, A230955.
Cf. A163870 (nontrivial divisors).
Related sequences:
Primes (p) and composites (c): A000040, A002808, A000720, A065855.
Primes between p(n) and 2*p(n): A063124, A070046; between c(n) and 2*c(n): A376761; between n and 2*n: A035250, A060715, A077463, A108954.
Composites between p(n) and 2*p(n): A246514; between c(n) and 2*c(n): A376760; between n and 2*n: A075084, A307912, A307989, A376759.

Programs

  • Haskell
    a002808 n = a002808_list !! (n-1)
    a002808_list = filter ((== 1) . a066247) [2..]
    -- Reinhard Zumkeller, Feb 04 2012
    
  • Magma
    [n: n in [2..250] | not IsPrime(n)]; // G. C. Greubel, Feb 24 2024
    
  • Maple
    t := []: for n from 2 to 20000 do if isprime(n) then else t := [op(t),n]; fi; od: t; remove(isprime,[$3..89]); # Zerinvary Lajos, Mar 19 2007
    A002808 := proc(n) option remember ; local a ; if n = 1 then 4; else for a from procname(n-1)+1 do if not isprime(a) then return a; end if; end do ; end if; end proc; # R. J. Mathar, Oct 27 2009
  • Mathematica
    Select[Range[2,100], !PrimeQ[#]&] (* Zak Seidov, Mar 05 2011 *)
    With[{nn=100},Complement[Range[nn],Prime[Range[PrimePi[nn]]]]] (* Harvey P. Dale, May 01 2012 *)
    Select[Range[100], CompositeQ] (* Jean-François Alcover, Nov 07 2021 *)
  • PARI
    A002808(n)=for(k=0,primepi(n),isprime(n++)&&k--);n \\ For illustration only: see below. - M. F. Hasler, Oct 31 2008
    
  • PARI
    A002808(n)= my(k=-1); while(-n + n += -k + k=primepi(n),); n \\ For n=10^4 resp. 3*10^4, this is about 100 resp. 500 times faster than the former; M. F. Hasler, Nov 11 2009
    
  • PARI
    forcomposite(n=1, 1e2, print1(n, ", ")) \\ Felix Fröhlich, Aug 03 2014
    
  • PARI
    for(n=1, 1e3, if(bigomega(n) > 1, print1(n, ", "))) \\ Altug Alkan, Oct 14 2015
    
  • Python
    from sympy import primepi
    def A002808(n):
        m, k = n, primepi(n) + 1 + n
        while m != k:
            m, k = k, primepi(k) + 1 + n
        return m # Chai Wah Wu, Jul 15 2015, updated Apr 14 2016
    
  • Python
    from sympy import isprime
    def ok(n): return n > 1 and not isprime(n)
    print([k for k in range(89) if ok(k)]) # Michael S. Branicky, Nov 07 2021
    
  • Python
    next_A002808=lambda n: next(n for n in range(n,n*5)if not isprime(n)) # next composite >= n > 0; next_A002808(n)==n <=> iscomposite(n). - M. F. Hasler, Mar 28 2025
    is_A002808=lambda n:not isprime(n) and n>1 # where isprime(n) can be replaced with: all(n%d for d in range(2, int(n**.5)+1))
    # generators of composite numbers:
    A002808_upto=lambda stop=1<<59: filter(is_A002808, range(2,stop))
    A002808_seq=lambda:(q:=2)and(n for p in primes if (o:=q)<(q:=p) for n in range(o+1,p)) # with, e.g.: primes=filter(isprime,range(2,1<<59)) # M. F. Hasler, Mar 28 2025
    
  • SageMath
    [n for n in (2..250) if not is_prime(n)] # G. C. Greubel, Feb 24 2024

Formula

a(n) = pi(a(n)) + 1 + n, where pi is the prime counting function.
a(n) = A136527(n, n).
A000005(a(n)) > 2. - Juri-Stepan Gerasimov, Oct 17 2009
A001222(a(n)) > 1. - Juri-Stepan Gerasimov, Oct 30 2009
A000203(a(n)) < A007955(a(n)). - Juri-Stepan Gerasimov, Mar 17 2011
A066247(a(n)) = 1. - Reinhard Zumkeller, Feb 05 2012
Sum_{n>=1} 1/a(n)^s = Zeta(s)-1-P(s), where P is prime zeta. - Enrique Pérez Herrero, Aug 08 2012
n + n/log n + n/log^2 n < a(n) < n + n/log n + 3n/log^2 n for n >= 4, see Panaitopol. Bojarincev gives an asymptotic version. - Charles R Greathouse IV, Oct 23 2012
a(n) > n + A000720(n) + 1. - François Huppé, Jan 08 2025

Extensions

Deleted an incomplete and broken link. - N. J. A. Sloane, Dec 16 2010

A341676 The unique superior prime divisor of each number that has one.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Feb 23 2021

Keywords

Comments

We define a divisor d|n to be superior if d >= n/d. Superior divisors are counted by A038548 and listed by A161908. Numbers with a superior prime divisor are listed by A063538.

Examples

			The sequence of superior prime divisors begins: {}, {2}, {3}, {2}, {5}, {3}, {7}, {}, {3}, {5}, {11}, {}, {13}, {7}, {5}, {}, {17}, {}, {19}, {5}, ...
		

Crossrefs

Inferior versions are A107286 (smallest), A217581 (largest), A056608.
These divisors (superior prime) are counted by A341591.
The strictly superior version is A341643.
A001221 counts prime divisors, with sum A001414.
A033676 selects the greatest inferior divisor.
A033677 selects the smallest superior divisor.
A038548 counts superior (or inferior) divisors.
A056924 counts strictly superior (or strictly inferior) divisors.
A060775 selects the greatest strictly inferior divisor.
A063538/A063539 have/lack a superior prime divisor.
A070038 adds up superior divisors.
A140271 selects the smallest strictly superior divisor.
A161908 lists superior divisors.
A207375 lists central divisors.
- Strictly Inferior: A070039, A333805, A333806, A341596, A341674, A341677.

Programs

  • Mathematica
    Join@@Table[Select[Divisors[n],PrimeQ[#]&&#>=n/#&],{n,100}]
  • PARI
    lista(nmax) = {my(p); for(n = 1, nmax, p = select(x -> (x^2 >= n), factor(n)[, 1]); if(#p == 1, print1(p[1], ", ")));} \\ Amiram Eldar, Nov 01 2024

A052369 Largest prime factor of n, where n runs through composite numbers.

Original entry on oeis.org

2, 3, 2, 3, 5, 3, 7, 5, 2, 3, 5, 7, 11, 3, 5, 13, 3, 7, 5, 2, 11, 17, 7, 3, 19, 13, 5, 7, 11, 5, 23, 3, 7, 5, 17, 13, 3, 11, 7, 19, 29, 5, 31, 7, 2, 13, 11, 17, 23, 7, 3, 37, 5, 19, 11, 13, 5, 3, 41, 7, 17, 43, 29, 11, 5, 13, 23, 31, 47, 19, 3, 7, 11, 5, 17, 13, 7, 53, 3, 11, 37, 7, 19, 23
Offset: 1

Views

Author

Michael Contente (mec1000(AT)aol.com), Mar 08 2000

Keywords

Examples

			First composite is 4, largest prime factor is 2, so a(1)=2.
		

Crossrefs

Cf. A002808, A006530, A056608. [From Reinhard Zumkeller, Aug 25 2008]

Programs

  • Magma
    [ D[ #D]: n in [2..115] | not IsPrime(n) where D is PrimeDivisors(n) ]; // [Klaus Brockhaus, Jun 23 2009]
    
  • Maple
    map(t -> max(numtheory:-factorset(t)), remove(isprime,[$2..10^3])); # Robert Israel, Aug 10 2014
  • Mathematica
    FactorInteger[#][[-1,1]]&/@Select[Range[150],CompositeQ] (* Harvey P. Dale, Jan 24 2016 *)
  • PARI
    forcomposite(n=1, 1e2, p=factor(n)[omega(n), 1]; print1(p, ", ")) \\ Felix Fröhlich, Aug 08 2014

Formula

a(n) = A006530(A002808(n)). [Reinhard Zumkeller, Aug 25 2008]

Extensions

More terms from James Sellers, Mar 09 2000

A163870 Triangle read by rows: row n lists the nontrivial divisors of the n-th composite.

Original entry on oeis.org

2, 2, 3, 2, 4, 3, 2, 5, 2, 3, 4, 6, 2, 7, 3, 5, 2, 4, 8, 2, 3, 6, 9, 2, 4, 5, 10, 3, 7, 2, 11, 2, 3, 4, 6, 8, 12, 5, 2, 13, 3, 9, 2, 4, 7, 14, 2, 3, 5, 6, 10, 15, 2, 4, 8, 16, 3, 11, 2, 17, 5, 7, 2, 3, 4, 6, 9, 12, 18, 2, 19, 3, 13, 2, 4, 5, 8, 10, 20, 2, 3, 6, 7, 14, 21, 2, 4, 11, 22, 3, 5, 9, 15, 2, 23
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 06 2009

Keywords

Comments

Row n contains row A002808(n) of table A027750.
T(n,k) = A027751(A002808(n),k+1), k = 1..A144925(n). - Reinhard Zumkeller, Mar 29 2014

Examples

			The table starts in row n=1 (with the composite 4) as
  2;
  2,3;
  2,4;
  3;
  2,5;
  2,3,4,6;
  2,7;
  3,5;
  2,4,8;
  2,3,6,9;
  2,4,5,10.
		

Crossrefs

Cf. A144925 (row lengths), A062825 (row sums), A056608 (left edge), A160180 (right edge).

Programs

  • Haskell
    a163870 n k = a163870_tabf !! (n-1) !! (k-1)
    a163870_row n = a163870_tabf !! (n-1)
    a163870_tabf = filter (not . null) $ map tail a027751_tabf
    -- Reinhard Zumkeller, Mar 29 2014
    
  • Mathematica
    Divisors[Select[Range[50], CompositeQ]][[All, 2 ;; -2]] (* Paolo Xausa, Dec 26 2024 *)
  • Python
    from itertools import islice
    def g():
        n, j = 1, 2
        while True:
            n = (n << 1) | 1
            p = 1
            for k in range(2, (j >> 1) + 1):
                p = (p << 1) | 1
                if n % p == 0: yield k
            j+=1
    print(list(islice(g(),95))) # Darío Clavijo, Dec 16 2024

Extensions

Entries checked by R. J. Mathar, Sep 22 2009

A160180 Largest proper divisor of the n-th composite number.

Original entry on oeis.org

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

Views

Author

Kyle Stern, May 03 2009, May 04 2009

Keywords

Comments

Old name: The n-th positive composite number divided by its lowest nontrivial factor.

Examples

			a(1) = 4/2 = 2, a(2) = 6/2 = 3, a(3) = 8/2 = 4, a(4) = 9/3 = 3, a(5) = 10/2 = 5.
		

Crossrefs

Programs

  • Haskell
    a160180 = a032742 . a002808  -- Reinhard Zumkeller, Mar 29 2014
  • MATLAB
    function [a] = A160180(k) j = 0; n = 1; while j < k if isprime(n) == 1 skip elseif isprime(n) == 0 j = j + 1; factors = factor(n); lowfactor = factors(1,1); a(j,1) = n/lowfactor; end n = n + 1; end - Kyle Stern, May 04 2009
    
  • Mathematica
    f[n_] := Block[{k = n + PrimePi@ n + 1}, While[k != n + PrimePi@ k + 1, k++ ]; k/FactorInteger[k][[1, 1]]]; Array[f, 75] (* Robert G. Wilson v, May 11 2012 *)
    Divisors[#][[-2]]&/@Select[Range[200],CompositeQ] (* Harvey P. Dale, Dec 06 2021 *)
    (# / FactorInteger[#][[1, 1]])& /@ Select[Range[300], CompositeQ] (* Amiram Eldar, Jun 18 2022 *)

Formula

a(n) = A032742(A002808(n)) = A002808(n) / A056608(n) = A163870(n,A144925(n)). - Reinhard Zumkeller, Mar 29 2014

Extensions

Indices of b-file corrected, more terms added using b-file. - N. J. A. Sloane, Aug 31 2009
New name from Reinhard Zumkeller, Mar 29 2014
Incorrect formula removed by Ridouane Oudra, Oct 15 2021

A073813 Difference between n and largest unrelated number belonging to n, when n runs over composite numbers. For primes and for 4, unrelated set is empty.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Aug 15 2002

Keywords

Comments

From Michael De Vlieger, Mar 28 2016 (Start):
a(0) = 0 since 4 is the smallest composite and "unrelated" numbers k with respect to n must be composite and smaller than n. Unrelated numbers k cannot be prime since primes p must either divide or be coprime to n; k cannot equal 1 since 1 is both a divisor of and coprime to n.
The test for unrelated numbers k that belong to n is 1 < gcd(k, n) < k.
(End)

Examples

			composite[1]=4, URS[4]={}, a(1)=0 by convention; n=14, c[14]=24, URS[24]={9,10,14,15,16,18,20,21,22}, a(14)=24-Max[URS[24]]=2.
		

Crossrefs

Cf. A056608. [From R. J. Mathar, Sep 23 2008]

Programs

  • Mathematica
    c[x_] := FixedPoint[x+PrimePi[ # ]+1&, x]; tn[x_] := Table[j, {j, 1, x}]; di[x_] := Divisors[x]; rrs[x_] := Flatten[Position[GCD[tn[x], x], 1]]; rs[x_] := Union[rrs[x], di[x]]; urs[x_] := Complement[tn[x], rs[x]]; Table[c[w]-Max[urs[c[w]]], {w, 1, 128}]
    Prepend[Function[k, k - SelectFirst[Range[k - 2, 2, -1], 1 < GCD[#, k] < # &]] /@ Select[Range[6, 138], ! PrimeQ@ # &], 0] (* Michael De Vlieger, Mar 28 2016, Version 10 *)

Formula

See program.

A141220 Write the n-th nonprime (A018252(n)) as a product of primes; increase one copy of the largest prime by 2 and decrease one copy of the smallest prime by 1, multiply the resulting numbers.

Original entry on oeis.org

1, 4, 5, 8, 10, 7, 10, 9, 14, 16, 15, 14, 18, 13, 20, 28, 15, 30, 18, 21, 32, 26, 19, 36, 30, 21, 30, 28, 27, 26, 42, 25, 40, 54, 35, 38, 30, 45, 52, 36, 42, 31, 42, 33, 54, 64, 60, 39, 38, 50, 45, 60, 39, 70, 42, 78, 45, 56, 90, 43, 54, 76, 45, 62, 52, 63, 90
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 07 2008

Keywords

Examples

			1st nonprime = 1 (has no prime factors); a(1) = empty product = 1.
2nd nonprime = 4 = (p(max)=2)*(p(min)=2); a(2) = (2+2)*(2-1) = 4*1 = 4.
3rd nonprime = 6 = (p(max)=3)*(p(min)=2); a(3) = (3+2)*(2-1) = 5*1 = 5.
4th nonprime = 8 = (p(max)=2)*(p=2)*(p(min)=2); a(4) = (2+2)*2*(2-1) = 4*2*1 = 8.
		

Programs

  • Maple
    A006530 := proc(n) if n = 1 then 1; else max(op(numtheory[factorset](n))) ; end if; end proc:
    A020639 := proc(n) if n = 1 then 1; else min(op(numtheory[factorset](n))) ; end if; end proc:
    A002808 := proc(n) if n = 1 then 4; else for a from procname(n-1)+1 do if not isprime(a) then return a; end if; end do; end if; end proc:
    A052369 := proc(n) A006530(A002808(n)) ; end proc: A056608 := proc(n) A020639(A002808(n)) ; end proc:
    A141220 := proc(n) if n = 0 then 1; else c := A002808(n) ; hi := A052369(n) ; lo := A056608(n) ; c*(hi+2)*(lo-1)/lo/hi ; end if; end proc:
    printf("1,") ; for n from 1 to 400 do a := A141220(n) ; if not isprime(a) then printf("%d,",a) ; end if; end do: # R. J. Mathar, Mar 29 2010
  • Mathematica
    nonp[1]=1;i=1;Do[If[n-PrimePi[n]>i,nonp[i+1]=n;i++],{n,2,lim}];f[k_]:=k*(FactorInteger[k][[1,1]]-1)/FactorInteger[k][[1,1]]*(FactorInteger[k][[-1,1]]+2)/FactorInteger[k][[-1,1]];Join[{1},f/@Array[nonp,66,2]] (* James C. McMahon, Jul 18 2025 *)

Extensions

Entry revised by Jon E. Schoenfield, Mar 09 2014, following revision of A141218 by N. J. A. Sloane
Showing 1-10 of 38 results. Next