OFFSET
1,2
LINKS
Carlos Rivera, The Inventory Sequences and Self-Inventoried Numbers, (see Question 7)
EXAMPLE
The "inventory" of 299 is 1229 (one "2", two "9"s), which is prime. Hence 299 belongs to the sequence.
MATHEMATICA
g[n_] := Module[{seen, r, d, l, i, t}, seen = {}; r = {}; d = IntegerDigits[n]; l = Length[d]; For[i = 1, i <= l, i++, t = d[[i]]; If[ ! MemberQ[seen, t], r = Join[r, IntegerDigits[Count[d, t]]]; r = Join[r, {t}]; seen = Append[seen, t]]]; FromDigits[r]]; Select[Range[10^3], PrimeQ[g[ # ]] &]
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Joseph L. Pe, Jan 14 2003
STATUS
approved