cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A285228 Primes with integer arithmetic mean of digits = 8 in base 10.

Original entry on oeis.org

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
Offset: 1

Views

Author

Jaroslav Krizek, Apr 19 2017

Keywords

Crossrefs

Primes from A061425. Subsequence of A069709.
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).

Programs

  • Magma
    [n: n in [1..100000] | IsPrime(n) and &+Intseq(n) mod #Intseq(n) eq 0 and &+Intseq(n) / #Intseq(n) eq 8];
    
  • Mathematica
    Select[Prime@ Range@ PrimePi[10^5], Mean@ IntegerDigits@ # == 8 &] (* Michael De Vlieger, Apr 22 2017 *)
  • 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))
    A285228_list = list(islice(A285228_gen(),30)) # Chai Wah Wu, Nov 28 2023