OFFSET
1,4
FORMULA
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.
A095195 has row n equal to the k-th differences of the prime numbers.
A113646 gives least nonprime >= n.
A377033 has row n equal to the k-th differences of the composite numbers.
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Jul 08 2010
EXTENSIONS
Inequality in the name reversed by Gus Wiseman, Dec 05 2024
STATUS
approved