A094457 a(n) is the largest number k < n in a neighborhood of n defined by prime factorization, specifically, A127185(n,k) <= 2.
1, 2, 2, 3, 4, 5, 4, 6, 6, 7, 8, 11, 10, 10, 8, 13, 12, 17, 12, 15, 14, 19, 16, 15, 22, 18, 20, 23, 20, 29, 16, 22, 26, 25, 24, 31, 34, 33, 24, 37, 30, 41, 28, 30, 38, 43, 32, 35, 30, 39, 44, 47, 36, 35, 40, 51, 46, 53, 40, 59, 58, 45, 32, 55, 44, 61, 52, 57, 50, 67, 48, 71, 62
Offset: 2
Examples
a(18)=12 because 18=2*3*3 and next smaller comparable factorization is 2*2*3=12 (A127185(18,12) = 2).
Links
- Michael De Vlieger, Table of n, a(n) for n = 2..10000
Programs
-
Mathematica
f[n_] := Block[{g, h}, g[x_] := Flatten[Table[#1, {#2}] & @@@ FactorInteger@ x]; h[x_] := If[x == 2, 1, NextPrime[x, -1]]; If[n == 1, 1, Max[Times @@ MapAt[h, g[n], #] & /@ Range[Length@ g[n]]]]]; Table[f@ i, {i, 2, 74}] (* Michael De Vlieger, Jan 31 2015 *)
Extensions
Edited, with new name, by Peter Munn, Oct 10 2023
Comments