login
A126867
Largest even semiprime <= n^2.
1
4, 6, 14, 22, 34, 46, 62, 74, 94, 118, 142, 166, 194, 218, 254, 278, 314, 358, 398, 422, 482, 526, 566, 622, 674, 718, 778, 838, 898, 958, 1018, 1082, 1154, 1214, 1294, 1366, 1438, 1514, 1594, 1678, 1762, 1838, 1934, 2018, 2102, 2206, 2302, 2386, 2498, 2594
OFFSET
2,1
LINKS
FORMULA
a(n) = max( A001358(i): A001358(i)<= A000290(n), A001358(i)= 0 mod 2). - R. J. Mathar, Mar 17 2007
MAPLE
isA001358 := proc(n) if numtheory[bigomega](n)=2 then true; else false; fi; end: A126867 := proc(n) local a; a := n^2; while not isA001358(a) or a mod 2 <> 0 do a := a-1; od; RETURN(a); end: for n from 2 to 90 do printf("%d, ", A126867(n)); od; # R. J. Mathar, Mar 17 2007
# Alternative:
f:= n -> 2*prevprime(ceil(n^2/2)): f(2):= 4:
map(f, [$2..100]); # Robert Israel, Jun 20 2019
MATHEMATICA
f[n_] := 2Prime[PrimePi[n^2/2]]; Table[f[n], {n, 2, 51}] (* Ray Chandler, Mar 17 2007 *)
les[n_]:=Module[{k=If[OddQ[n^2], n^2-1, n^2]}, Until[PrimeOmega[k]==2, k-=2]; Abs[k]]; Array[les, 60, 2] (* Harvey P. Dale, Aug 29 2022 *)
CROSSREFS
Sequence in context: A366217 A210632 A097271 * A027632 A175722 A200186
KEYWORD
easy,nonn
AUTHOR
Giovanni Teofilatto, Mar 16 2007
EXTENSIONS
Extended by Ray Chandler, Robert G. Wilson v and R. J. Mathar, Mar 17 2007
STATUS
approved