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

A007917 Version 1 of the "previous prime" function: largest prime <= n.

Original entry on oeis.org

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

Views

Author

R. Muller

Keywords

Comments

Version 2 of the "previous prime" function (see A151799) is "largest prime < n". This produces the same sequence of numerical values, except the offset (or indexing) starts at 3 instead of 2.
Maple's "prevprime" function uses version 2.
Also the largest prime dividing n! or lcm(1,...,n). - Labos Elemer, Jun 22 2000
Also largest prime among terms of (n+1)st row of Pascal's triangle. - Jud McCranie, Jan 17 2000
Also largest integer k such that A000203(k) <= n+1. - Benoit Cloitre, Mar 17 2002. - Corrected by Antti Karttunen, Nov 07 2017
Also largest prime factor of A061355(n) (denominator of Sum_{k=0..n} 1/k!). - Jonathan Sondow, Jan 09 2005
Also prime(pi(x)) where pi(x) is the prime counting function = number of primes <= x. - Cino Hilliard, May 03 2005
Also largest prime factor, occurring to the power p, in denominator of Sum_{k=1..n} 1/k^p, for any positive integer p. - M. F. Hasler, Nov 10 2006
For n > 10, these values are close to the most negative eigenvalues of A191898 (conjecture). - Mats Granvik, Nov 04 2011

References

  • K. Atanassov, On the 37th and the 38th Smarandache Problems, Notes on Number Theory and Discrete Mathematics, Sophia, Bulgaria, Vol. 5 (1999), No. 2, 83-85.
  • J. Castillo, Other Smarandache Type Functions: Inferior/Superior Smarandache f-part of x, Smarandache Notions Journal, Vol. 10, No. 1-2-3, 1999, 202-204.

Crossrefs

Programs

Formula

Equals A006530(A000142(n)). - Jonathan Sondow, Jan 09 2005
Equals A006530(A056040(n)). - Peter Luschny, Mar 04 2011
a(n) = A000040(A049084(A007918(n)) + 1 - A010051(n)). - Reinhard Zumkeller, Jul 26 2012
From Wesley Ivan Hurt, May 22 2013: (Start)
omega( Product_{i=2..n} a(i) ) = pi(n).
Omega( Product_{i=2..n} a(i) ) = n - 1. (End)
For n >= 2, a(A000203(n)) = A070801(n). - Antti Karttunen, Nov 07 2017
a(n) = n + 1 - Sum_{i=1..n} floor(pi(i)/pi(n)) = n + 1 - A175851(n). - Ridouane Oudra, Jun 24 2024
Conjecture: a(n) = floor(log(Sum_{k=2..n} exp(A000010(k)+1))). - Joseph M. Shunia, Aug 09 2024
a(n) = A000040(A000720(n)). - Ridouane Oudra, Oct 04 2024

Extensions

Edited by N. J. A. Sloane, Apr 06 2008

A014684 In the sequence of positive integers subtract 1 from each prime number.

Original entry on oeis.org

1, 1, 2, 4, 4, 6, 6, 8, 9, 10, 10, 12, 12, 14, 15, 16, 16, 18, 18, 20, 21, 22, 22, 24, 25, 26, 27, 28, 28, 30, 30, 32, 33, 34, 35, 36, 36, 38, 39, 40, 40, 42, 42, 44, 45, 46, 46, 48, 49, 50, 51, 52, 52, 54, 55, 56, 57, 58, 58, 60, 60, 62, 63, 64, 65, 66, 66, 68, 69, 70, 70, 72
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a014684 n = n - fromIntegral (a010051 n)
    -- Reinhard Zumkeller, Sep 10 2013
    
  • Magma
    [n - (IsPrime(n) select 1 else 0): n in [1..80]]; // Bruno Berselli, Jul 18 2016
    
  • Mathematica
    Table[If[PrimeQ[n],n-1,n],{n,100}] (* Harvey P. Dale, Aug 27 2015 *)
  • Python
    from sympy import isprime
    def A014684(n): return n-int(isprime(n)) # Chai Wah Wu, Oct 14 2023

Formula

a(n) = A005171(n) + n - 1.
a(n) = phi(n!)/phi((n-1)!). - Vladeta Jovovic, Nov 30 2002
For n > 3: a(n) = A113523(n) = A179278(n). - Reinhard Zumkeller, Jul 08 2010
a(n) = n - A010051(n). - Reinhard Zumkeller, Sep 10 2013

Extensions

More terms from Andrew J. Gacek (andrew(AT)dgi.net)

A179278 Largest nonprime integer <= n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jul 08 2010

Keywords

Examples

			From _Gus Wiseman_, Dec 04 2024: (Start)
The nonprime integers <= n:
  1  1  1  4  4  6  6  8  9  10  10  12  12  14  15  16
           1  1  4  4  6  8  9   9   10  10  12  14  15
                 1  1  4  6  8   8   9   9   10  12  14
                       1  4  6   6   8   8   9   10  12
                          1  4   4   6   6   8   9   10
                             1   1   4   4   6   8   9
                                     1   1   4   6   8
                                             1   4   6
                                                 1   4
                                                     1
(End)
		

Crossrefs

For prime we have A007917.
For nonprime we have A179278 (this).
For squarefree we have A070321.
For nonsquarefree we have A378033.
For prime power we have A031218.
For non prime power we have A378367.
For perfect power we have A081676.
For non perfect power we have A378363.
A000040 lists the primes, differences A001223.
A002808 lists the composite numbers, differences A073783.
A018252 lists the nonprimes, differences A065310.
A095195 has row n equal to the k-th differences of the prime numbers.
A113646 gives least nonprime >= n.
A151800 gives the least prime > n, weak version A007918.
A377033 has row n equal to the k-th differences of the composite numbers.

Programs

  • Mathematica
    Array[# - Boole[PrimeQ@ #] - Boole[# == 3] &, 72] (* Michael De Vlieger, Oct 13 2018 *)
    Table[Max@@Select[Range[n],!PrimeQ[#]&],{n,30}] (* Gus Wiseman, Dec 04 2024 *)
  • PARI
    a(n) = if (isprime(n), if (n==3, 1, n-1), n); \\ Michel Marcus, Oct 13 2018

Formula

For n > 3: a(n) = A113523(n) = A014684(n);
For n > 0: a(n) = A113638(n). - Georg Fischer, Oct 12 2018
A005171(a(n)) = 1; A010051(a(n)) = 0.
a(n) = A018252(A062298(n)). - Ridouane Oudra, Aug 22 2025

Extensions

Inequality in the name reversed by Gus Wiseman, Dec 05 2024

A284383 a(1) = 1, a(2) = 2, a(3) = 3, a(4) = 2; a(n) is the largest composite number <= (a(n-a(n-1)) + a(n-a(n-2))) for n > 4.

Original entry on oeis.org

1, 2, 3, 2, 4, 4, 6, 4, 6, 6, 8, 6, 10, 6, 10, 10, 12, 8, 14, 10, 14, 10, 16, 10, 16, 16, 16, 12, 22, 12, 20, 16, 22, 14, 24, 16, 24, 16, 26, 16, 26, 26, 24, 18, 30, 22, 28, 26, 30, 20, 34, 24, 36, 20, 38, 24, 36, 24, 40, 26, 38, 26, 40, 26, 42, 26, 42, 42, 32, 28, 50, 28, 46, 34
Offset: 1

Views

Author

Altug Alkan, Mar 26 2017

Keywords

Examples

			a(5) = 4 because a(5 - a(4)) + a(5 - a(3)) = a(3) + a(2) = 3 + 2 = 5 and largest composite number <= 5 is 4.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[n <= 4, n - 2 Boole[n == 4], k = 0; While[! CompositeQ@ Set[m, a[n - a[n - 1]] + a[n - a[n - 2]] - k], k++]; m]; Array[a, 74] (* Michael De Vlieger, Mar 29 2017 *)
  • PARI
    f(n) = n-isprime(n);
    a=vector(1000); a[1]=1;a[2]=2;a[3]=3; for(n=4, #a, a[n] = f(a[n-a[n-1]]+a[n-a[n-2]])); a

Formula

a(1) = 1, a(2) = 2, a(3) = 3; a(n) = a(n-a(n-1)) + a(n-a(n-2)) - A010051(a(n-a(n-1)) + a(n-a(n-2))) for n > 3.

A113636 In the sequence of positive integers add 1 to each nonprime number.

Original entry on oeis.org

2, 2, 3, 5, 5, 7, 7, 9, 10, 11, 11, 13, 13, 15, 16, 17, 17, 19, 19, 21, 22, 23, 23, 25, 26, 27, 28, 29, 29, 31, 31, 33, 34, 35, 36, 37, 37, 39, 40, 41, 41, 43, 43, 45, 46, 47, 47, 49, 50, 51, 52, 53, 53, 55, 56, 57, 58, 59, 59, 61, 61, 63, 64, 65, 66, 67, 67, 69, 70, 71, 71, 73
Offset: 1

Views

Author

Cino Hilliard, Jan 15 2006

Keywords

Comments

This is the complement of sequence A014683.
Möbius transform of A380449(n). - Wesley Ivan Hurt, Jun 21 2025

Crossrefs

Programs

  • Mathematica
    Array[# + Boole[! PrimeQ@ #] &, 72] (* Michael De Vlieger, Nov 05 2020 *)
  • PARI
    a(n) = if (!isprime(n), n+1, n); \\ Michel Marcus, Nov 06 2020

Formula

a(n) = A014684(n) + 1. - Bill McEachen, Nov 01 2020
From Wesley Ivan Hurt, Jun 21 2025: (Start)
a(n) = n + c(n), where c = A005171.
a(n) = Sum_{d|n} A380449(d) * mu(n/d). (End)

Extensions

Offset 1 from Michel Marcus, Nov 06 2020
Showing 1-5 of 5 results.