OFFSET
1,1
LINKS
Jaroslav Krizek, Table of n, a(n) for n = 1..1000
MATHEMATICA
Select[Prime@ Range@ PrimePi@ 40000, Mean@ IntegerDigits@ # == 7 &] (* 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 7]
(Python)
from itertools import count, islice
from collections import Counter
from sympy.utilities.iterables import partitions, multiset_permutations
from sympy import isprime
def A285227_gen(): # generator of terms
yield 7
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(7*l-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
KEYWORD
nonn,base
AUTHOR
Jaroslav Krizek, Apr 19 2017
STATUS
approved