|
|
A285228
|
|
Primes with integer arithmetic mean of digits = 8 in base 10.
|
|
6
|
|
|
79, 97, 6899, 8699, 8969, 9689, 9887, 49999, 68899, 69997, 77899, 78889, 78979, 79699, 79987, 85999, 88789, 88897, 88969, 89599, 89689, 89779, 89797, 89959, 89977, 94999, 95989, 96799, 96979, 96997, 97789, 97879, 97987, 98689, 98779, 98869, 98887, 99679, 99787
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
MATHEMATICA
|
Select[Prime@ Range@ PrimePi[10^5], Mean@ IntegerDigits@ # == 8 &] (* Michael De Vlieger, Apr 22 2017 *)
|
|
PROG
|
(Magma) [n: n in [1..100000] | IsPrime(n) and &+Intseq(n) mod #Intseq(n) eq 0 and &+Intseq(n) / #Intseq(n) eq 8]
(Python)
from itertools import count, islice
from collections import Counter
from sympy.utilities.iterables import partitions, multiset_permutations
def A285228_gen(): # generator of terms
for l in count(2):
for i in range(1, 10):
yield from sorted(q for q in (int(str(i)+''.join(map(str, j))) for s, p in partitions((l<<3)-i, m=l-1, k=9, size=True) for j in multiset_permutations([0]*(l-1-s)+list(Counter(p).elements()))) if isprime(q))
|
|
CROSSREFS
|
Sequences of primes such that a(n) = k for k = 1, 2, 4, 5, 7 and 8: A069710 (k = 1), A285096 (k = 2), A285225 (k = 4), A285226 (k = 5), A285227 (k = 7), this sequence (k = 8).
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|