editing
approved
editing
approved
a = {}; c = 0; For[n = 4, n < 10000, n++, If[Sum[FactorInteger[n][[i, 2]], {i, 1, Length[FactorInteger[n]]}] == 2, c++; If[Plus @@ IntegerDigits[c] == Plus @@ IntegerDigits[n], AppendTo[a, c]]]]; a - _(* _Stefan Steinerberger_, Dec 29 2007 *)
approved
editing
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]; Select[Range@ 1000, fQ@# &] (* _Robert G. Wilson v _ *)
editing
approved
nn=5000; With[{sp=Select[Range[nn], PrimeOmega[#]==2&]}, Select[Range[ Length[sp]], Total[ IntegerDigits[sp[[#]]]] ==Total[ IntegerDigits[#]]&]] (* Harvey P. Dale, Oct 15 2012 *)
approved
editing
a = {}; c = 0; For[n = 4, n < 10000, n++, If[Sum[FactorInteger[n][[i, 2]], {i, 1, Length[FactorInteger[n]]}] == 2, c++; If[Plus @@ IntegerDigits[c] == Plus @@ IntegerDigits[n], AppendTo[a, c]]]]; a - _Stefan Steinerberger (stefan.steinerberger(AT)gmail.com), _, Dec 29 2007
Corrected and extended by _Stefan Steinerberger (stefan.steinerberger(AT)gmail.com) _ and Robert G. Wilson v, Dec 29 2007
_Jonathan Vos Post (jvospost3(AT)gmail.com), _, Dec 27 2007
Corrected and extended by Stefan Steinerberger (stefan.steinerberger(AT)gmail.com) and _Robert G. Wilson v (rgwv(AT)rgwv.com), _, Dec 29 2007
base,easy,nonn,less,new
Jonathan Vos Post (jvospost2jvospost3(AT)yahoogmail.com), Dec 27 2007
Numbers n such that the sum of digits of n-th semiprime equals sum of digits of n.
5, 6, 19, 40, 41, 42, 70, 71, 85, 89, 128, 148, 149, 166, 199, 246, 257, 271, 285, 327, 339, 346, 448, 449, 469, 484, 566, 592, 605, 617, 634, 643, 644, 676, 682, 694, 710, 713, 719, 740, 748, 751, 752, 753, 782, 793, 794, 797, 798, 815, 890, 901, 905, 961
1,1
a(1) = 5 because semiprime(5) = 14, whose sum of digits is 5, the same as its index as a semiprime.
a = {}; c = 0; For[n = 4, n < 10000, n++, If[Sum[FactorInteger[n][[i, 2]], {i, 1, Length[FactorInteger[n]]}] == 2, c++; If[Plus @@ IntegerDigits[c] == Plus @@ IntegerDigits[n], AppendTo[a, c]]]]; a - Stefan Steinerberger (stefan.steinerberger(AT)gmail.com), Dec 29 2007
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]; Select[Range@ 1000, fQ@# &] (* Robert G. Wilson v *)
base,easy,nonn,less
Jonathan Vos Post (jvospost2(AT)yahoo.com), Dec 27 2007
Corrected and extended by Stefan Steinerberger (stefan.steinerberger(AT)gmail.com) and Robert G. Wilson v (rgwv(AT)rgwv.com), Dec 29 2007
approved