login
A117322
a(n) = prime(n) modulo semiprime(n).
4
2, 3, 5, 7, 11, 13, 17, 19, 23, 3, 31, 3, 6, 5, 8, 7, 10, 10, 12, 14, 15, 17, 18, 20, 23, 24, 21, 22, 23, 26, 36, 38, 43, 44, 43, 40, 42, 45, 48, 52, 57, 58, 62, 60, 63, 58, 69, 80, 82, 83, 78, 81, 82, 90, 91, 94, 92, 93, 94, 96, 96, 99, 106, 109, 110, 112, 125, 128, 134, 135
OFFSET
1,1
LINKS
FORMULA
a(n) = A000040(n) modulo A001358(n).
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
Sequence in context: A151796 A113580 A242124 * A242123 A229787 A329147
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Mar 08 2006
STATUS
approved