OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1) = 2 mod 4 = 2.
a(2) = 3 mod 6 = 3.
a(3) = 5 mod 9 = 5.
a(4) = 7 mod 10 = 7.
a(5) = 11 mod 14 = 11.
MATHEMATICA
SemiPrimePi[n_] := Sum[PrimePi[n/Prime@i] - i + 1, {i, PrimePi@Sqrt@n}]; SemiPrime[n_] := Block[{e = Floor[Log[2, n] + 1], a, b}, a = 2^e; Do[b = 2^p; While[SemiPrimePi[a] < n, a = a + b]; a = a - b/2, {p, e, 0, -1}]; a + b/2]; Table[ Mod[Prime@n, SemiPrime@n], {n, 70}] (* Robert G. Wilson v, May 01 2006 *)
Module[{nn=300, sprs}, sprs=Select[Range[nn], PrimeOmega[#]==2&]; Mod[ #[[1]], #[[2]]]&/@Thread[{Prime[Range[Length[sprs]]], sprs}]] (* Harvey P. Dale, Nov 21 2021 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Mar 08 2006
STATUS
approved