OFFSET
2,1
LINKS
Robert Israel, Table of n, a(n) for n = 2..10000
FORMULA
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
KEYWORD
easy,nonn
AUTHOR
Giovanni Teofilatto, Mar 16 2007
EXTENSIONS
STATUS
approved