login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A179278
Largest nonprime integer <= n.
9
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,4
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.
EXAMPLE
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)
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 *)
PROG
(PARI) a(n) = if (isprime(n), if (n==3, 1, n-1), n); \\ Michel Marcus, Oct 13 2018
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.
Sequence in context: A276679 A163638 A113523 * A365216 A132882 A171384
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Jul 08 2010
EXTENSIONS
Inequality in the name reversed by Gus Wiseman, Dec 05 2024
STATUS
approved