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.

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