OFFSET
1,1
COMMENTS
I call n a "k-apex" (or "apex of height k") of the arithmetical function f if n satisfies f(n-k) < ... < f(n-1) < f(n) > f(n+1) > .... > f(n+k).
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
omega(104003), ..., omega(104006), ..., omega(104009) equal 1, 3, 4, 5, 3, 2, 1, respectively. Hence 104006 is a term of the sequence.
MATHEMATICA
omega[n_] := Length[FactorInteger[n]]; Select[Range[5, 10^6], omega[ # - 3] < omega[ # - 2] < omega[ # - 1] < omega[ # ] > omega[ # + 1] > omega[ # + 2] > omega[ # + 3] &]
okQ[{a_, b_, c_, d_, e_, f_, g_}]:=a<b<c<d>e>f>g; Flatten[ Position[ Partition[ PrimeNu[ Range[167*10^4]], 7, 1], _?(okQ[#]&)]]+3 (* Harvey P. Dale, Jul 27 2019 *)
PROG
(Magma) pd:=PrimeDivisors; f:=func<n|#pd(n-3) lt #pd(n-2) and #pd(n-2) lt #pd(n-1) and #pd(n-1) lt #pd(n)>; f1:=func<n|#pd(n) gt #pd(n+1) and #pd(n+1) gt #pd(n+2) and #pd(n+2) gt #pd(n+3)>; [k:k in [4..170000]|f(k) and f1(k)]; // Marius A. Burtea, Feb 18 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Nov 13 2002
EXTENSIONS
a(10)-a(26) from Donovan Johnson, Feb 07 2009
STATUS
approved