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

A056608 Least prime factor of the n-th composite number.

Original entry on oeis.org

2, 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, 2
Offset: 1

Views

Author

Odimar Fabeny, Aug 07 2000

Keywords

Comments

Record values are seen when n = A120389(m). Conjecture: at each new record the count of the prior record follows A247509. Records seen are 2, 3, 5, 7, 11, ... and when 3, 5, 7, 11 are first seen, there have been 3, 3, 2, and 4 occurrences of 2, 3, 5, and 7. These are A247509(1) through A247509(4). Thus, the count for prime(60) would be A247509(60). - Bill McEachen, Jun 17 2024

Crossrefs

Cf. A052369 (largest prime factor of n, where n runs through composite numbers). - Klaus Brockhaus, Jun 23 2009
Cf. A160180.

Programs

  • Haskell
    a056608 = a020639 . a002808  -- Reinhard Zumkeller, Mar 29 2014
    
  • Magma
    [ PrimeDivisors(n)[1]: n in [2..140] | not IsPrime(n) ]; // Klaus Brockhaus, Jun 23 2009
    
  • Mathematica
    DeleteCases[Table[FactorInteger[n][[1, 1]] * Boole[Not[PrimeQ[n]]], {n, 2, 100}], 0] (* Alonso del Arte, Aug 21 2014 *)
    FactorInteger[#][[1,1]]&/@Select[Range[200],CompositeQ] (* Harvey P. Dale, Mar 16 2023 *)
  • PARI
    forcomposite(n=1, 1e2, p=factor(n)[1, 1]; print1(p, ", ")) \\ Felix Fröhlich, Aug 03 2014
    
  • Python
    from sympy import composite, factorint
    def A056608(n):
        return min(factorint(composite(n))) # Chai Wah Wu, Jul 22 2019

Formula

a(n) = A020639(A002808(n)) = A000040(A118663(n)). - M. F. Hasler, Apr 03 2012

Extensions

More terms from James Sellers, Aug 25 2000
Definition corrected by Reinhard Zumkeller, Mar 29 2014
Name changed by Alonso del Arte, Aug 21 2014

A088739 Smallest semiprime divisor of n-th composite number.

Original entry on oeis.org

4, 6, 4, 9, 10, 4, 14, 15, 4, 6, 4, 21, 22, 4, 25, 26, 9, 4, 6, 4, 33, 34, 35, 4, 38, 39, 4, 6, 4, 9, 46, 4, 49, 10, 51, 4, 6, 55, 4, 57, 58, 4, 62, 9, 4, 65, 6, 4, 69, 10, 4, 74, 15, 4, 77, 6, 4, 9, 82, 4, 85, 86, 87, 4, 6, 91, 4, 93, 94, 95, 4, 14, 9, 4, 6, 4, 15, 106, 4, 10, 111, 4
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 12 2003

Keywords

Comments

This is to semiprimes A001358 as A052369 is to primes A000040. - Jonathan Vos Post, Jan 11 2011

Crossrefs

Programs

  • Mathematica
    semiPrimeQ[n_] := Plus @@ Last /@ FactorInteger@ n == 2; f[n_] := Min@ Select[ Divisors@ n, semiPrimeQ] /. {\[Infinity] -> 0}; f /@ Rest@ Select[ Range@ 112, !PrimeQ@ # &]
    Reap[Do[If[! PrimeQ[n], Sow[Select[Divisors[n], PrimeOmega[#] == 2 &][[1]]]],{n, 4, 1200}]][[2, 1]] (* Zak Seidov, Mar 18 2013 *)

A087040 2nd largest prime factor of n-th composite number.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 01 2003

Keywords

Comments

a(n) = A087039(A002808(n));
a(n) = A006530(A002808(n)/A052369(n)).

Crossrefs

Programs

  • Maple
    f:= proc(n) local F;
      if isprime(n) then return NULL fi;
      F:= sort(ifactors(n)[2],(a,b) -> a[1]>b[1]);
      if F[1][2] >= 2 then F[1][1] else F[2][1] fi
    end proc:
    map(f, [$2..200]); # Robert Israel, Feb 20 2024
  • Mathematica
    Table[l=FactorInteger[ResourceFunction["Composite"][n]];If[Last[l][[2]]>1,Last[l][[1]],First[Part[l,-2]]],{n,102}] (* James C. McMahon, Feb 20 2024 *)

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

A141284 a(n) = (p_max - 1)*...*p*...*(p_min + 2), where p_max*...*p*...*p_min = k(n) = n-th composite.

Original entry on oeis.org

4, 8, 8, 10, 16, 16, 24, 20, 16, 24, 32, 30, 40, 32, 28, 48, 30, 48, 48, 32, 50, 64, 42, 48, 72, 60, 64, 72, 80, 60, 88, 64, 54, 80, 80, 96, 72, 70, 96, 90, 112, 96, 120, 90, 64, 84, 120, 128, 110, 120, 96, 144, 100, 144, 90, 144, 128, 90, 160, 144, 112, 168, 140, 160
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 08 2008

Keywords

Comments

In the prime factorization of the n-th composite, replace one instance of the largest prime factor A052369(n) with A052369(n)-1 and replace one instance of the smallest prime factor A056608(n) with A056608(n)+2.

Examples

			For n=1, k(1) = 4 = (p_max=2)*(p_min=2), so a(1) = (2-1)*(2+2) = 1*4 = 4;
for n=2, k(2) = 6 = (p_max=3)*(p_min=2), so a(2) = (3-1)*(2+2) = 2*4 = 8;
for n=3, k(3) = 8 = (p_max=2)*(p=2)*(p_min=2), so a(3) = (2-1)*2*(2+2) = 1*2*4 = 8; etc.
		

Crossrefs

Cf. A002808.

Programs

  • Mathematica
    Map[Times @@ Flatten[{#[[1]] + 2, #[[2 ;; -2]], #[[-1]] - 1}] &@ Flatten[ConstantArray[#1, #2] & @@@ FactorInteger[#]] &, Select[Range[120], CompositeQ]] (* Michael De Vlieger, Jan 25 2023 *)

Formula

a(n) = A002808(n)*(A052369(n)-1)*(A056608(n)+2)/(A052369(n)*A056608(n)).

Extensions

Definition and examples corrected and entries checked by R. J. Mathar, Mar 29 2010
Simplified by Jon E. Schoenfield, Jan 25 2023

A161986 a(n) = k+r where k is composite(n) and r is (largest prime divisor of k) mod (smallest prime divisor of k).

Original entry on oeis.org

4, 7, 8, 9, 11, 13, 15, 17, 16, 19, 21, 22, 23, 25, 25, 27, 27, 29, 31, 32, 35, 35, 37, 37, 39, 40, 41, 43, 45, 47, 47, 49, 49, 51, 53, 53, 55, 56, 57, 58, 59, 61, 63, 64, 64, 68, 67, 69, 71, 71, 73, 75, 77, 77, 81, 79, 81, 81, 83, 85, 87, 87, 89, 89, 91, 97, 93, 94, 95, 99, 97
Offset: 1

Views

Author

Klaus Brockhaus, Jun 23 2009

Keywords

Comments

Auxiliary sequence for A161850, which is the subsequence consisting of all terms that are prime.
a(n) = A002808(n)+A161849(n).

Examples

			n = 1: composite(1) = 4; (largest prime divisor of 4) = (smallest prime divisor 4) = 2; 2 mod 2 = 0. Hence a(1) = 4+0 = 4.
n = 5: composite(5) = 10; (largest prime divisor of 10) = 5; (smallest prime divisor 10) = 2; 5 mod 2 = 1. Hence a(5) = 10+1 = 11.
		

Crossrefs

Cf. A161850, A002808 (composite numbers), A052369 (largest prime factor of n-th composite), A056608 (smallest divisor of n-th composite), A161849 (A052369(n) mod A056608(n)).

Programs

  • Magma
    [ n + D[ #D] mod D[1]: n in [2..100] | not IsPrime(n) where D is PrimeDivisors(n) ];
    
  • PARI
    genit(maxx=1000)={ctr=0;arr=List();forcomposite(k=4,+oo,v=factor(k)[,1];r=v[#v]%v[1];ctr+=1;if(ctr>=maxx,break);listput(arr,k+r));arr} \\ Bill McEachen, Nov 17 2021

A179312 Largest semiprime dividing n, or 0 if no semiprime divides n.

Original entry on oeis.org

0, 0, 0, 4, 0, 6, 0, 4, 9, 10, 0, 6, 0, 14, 15, 4, 0, 9, 0, 10, 21, 22, 0, 6, 25, 26, 9, 14, 0, 15, 0, 4, 33, 34, 35, 9, 0, 38, 39, 10, 0, 21, 0, 22, 15, 46, 0, 6, 49, 25, 51, 26, 0, 9, 55, 14, 57, 58, 0, 15, 0, 62, 21, 4, 65, 33, 0, 34, 69, 35, 0, 9, 0, 74
Offset: 1

Views

Author

Jonathan Vos Post, Jan 11 2011

Keywords

Comments

a(p in primes A000040) = 0; a(k in semiprimes A001358) = k. This is to semiprimes A001358 as A006530 is to primes A000040.

Examples

			The smallest semiprime is 4, so a(n<4) = 0.
a(4) = 4, since 4 = 2^2 is semiprime, and 4 | 4 (i.e., 4/4 = 1).
a(5) = 0 because 5 is prime, only 1 and 5 evenly divide 5, no prime (with 1 prime factor) is a semiprimes (with two prime factors, not necessarily distinct).
a(6) = 6, since 6 = 2*3 is semiprime, and 6 | ^ (i.e., 6/6 = 1).
a(8) = 4, since 4 = 2^2 is semiprime, and 4 | 8 (i.e., 8/4 = 2).
		

Crossrefs

Cf. A088739 (smallest semiprime divisor of n-th composite number).

Programs

  • Maple
    a:= proc(n) local l;
          if n<4 or isprime(n) then 0
        else l:= sort(ifactors(n)[2], (x, y)-> x[1]>y[1]);
             l[1][1] *l[`if`(l[1][2]>=2, 1, 2)][1]
          fi
        end:
    seq(a(n), n=1..80);  # Alois P. Heinz, Jun 23 2012
  • Mathematica
    semiPrimeQ[n_] := Plus @@ Last /@ FactorInteger@ n == 2; f[n_] := Max@ Select[ Divisors@ n, semiPrimeQ] /. {-\[Infinity] -> 0}; Array[f, 55]

Formula

a(n) = MAX(0, k in A001358 such that k | n).

A136023 The largest prime factor among all composites <= 10^n.

Original entry on oeis.org

5, 47, 499, 4999, 49999, 499979, 4999999, 49999991, 499999993, 4999999937, 49999999967, 499999999979, 4999999999937, 49999999999981, 499999999999999, 4999999999999997, 49999999999999993, 499999999999999931, 4999999999999999963, 49999999999999999951
Offset: 1

Views

Author

Enoch Haga, Dec 12 2007

Keywords

Comments

This is the largest single divisor contributing to A136021(n).
If 4 concatenated with n-1 nines is prime, it will be the largest factor. This candidate does not work for n=6 because 499999 is not prime.

Examples

			a(3)=499 because it is the largest prime factor of all k<=10^3; the largest k in that interval with this factor is k=2*499 = 998.
		

Crossrefs

Programs

  • Maple
    5, seq(prevprime(5*10^n),n=1..100); # Robert Israel, Jul 21 2014

Extensions

Edited and more terms added by R. J. Mathar, Apr 17 2009

A141554 Transformed nonprime products of prime factors of the composites, the largest prime decremented by 2 and the smallest prime incremented by 2.

Original entry on oeis.org

0, 4, 0, 12, 8, 20, 15, 0, 12, 24, 25, 36, 16, 21, 44, 15, 40, 36, 0, 45, 60, 35, 24, 68, 55, 48, 60, 72, 45, 84, 32, 45, 60, 75, 88, 36, 63, 80, 85, 108, 72, 116, 75, 0, 77, 108, 120, 105, 100, 48, 140, 75, 136, 81, 132, 96, 45, 156, 120, 105, 164, 135, 144, 108, 99, 168
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 14 2008

Keywords

Comments

In the prime number decomposition of k=A002808(i), i=1,2,3,.., one instance of the largest prime, pmax=A052369(i), is replaced by pmax-2 and one instance of the smallest prime, pmin=A056608(i), is replaced by pmin+2. If the product of this modified list of factors, k*(pmax-2)*(pmin+2)/(pmin*pmax), is nonprime, it is added to the sequence.

Examples

			k(1)=4=(p(max)=2)*(p(min)=2), transformed (2-2)*(2+2)=0*4=0=a(1).
k(2)=6=(p(max)=3)*(p(min)=2), transformed (3-2)*(2+2)=1*4=4=a(2).
k(3)=8=(p(max)=2)*(p=2)*(p(min)=2), transformed (2-2)*2*(2+2)=0*2*4=0=a(3).
k(4)=9=(p(max)=3)*(p(min)=3), transformed (3-2)*(3+2)=1*5=5 (prime, skipped).
k(5)=10=(p(max)=5)*(p(min)=2), transformed (5-2)*(2+2)=3*4=12=a(4).
		

Crossrefs

Extensions

Edited and corrected by R. J. Mathar, Aug 18 2008
Showing 1-10 of 25 results. Next