Monica Set

Author

Eric W. Weisstein
December 30, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/IntegerSequences/MonicaSet.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/MonicaSet.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Code

DigitSum[d_]:=Total[IntegerDigits[d]]
PrimeList[d_]:=Flatten[Table[#1,{#2}]&@@@FactorInteger[d]]

MonicaQ[n_,x_Integer?PrimeQ]:=False
MonicaQ[n_,x_Integer?Positive]:=Mod[DigitSum[x]+Toal[DigitSum/@PrimeList[x]],n]==0

Tables

Select[Range[20],MonicaQ[1,#]&]

A018252

Select[Range[100],MonicaQ[2,#]&]

Select[Range[100],MonicaQ[3,#]&]