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.

Showing 1-3 of 3 results.

A069710 Primes with arithmetic mean of digits = 1 (sum of digits = number of digits).

Original entry on oeis.org

11, 1021, 1201, 2011, 3001, 10103, 10211, 10301, 11003, 12011, 12101, 13001, 20021, 20201, 21011, 21101, 30011, 1000033, 1000213, 1000231, 1000303, 1001023, 1001041, 1001311, 1001401, 1002121, 1003003, 1003111, 1003201, 1010131
Offset: 1

Views

Author

Amarnath Murthy, Apr 08 2002

Keywords

Comments

The sum of the digits of a prime > 3 cannot be a multiple of 3, hence no prime with 3*k digits can be here. - David Radcliffe, May 05 2015
Subsequence of primes of A061384. - Michel Marcus, May 05 2015

Crossrefs

Programs

  • Maple
    F:= proc(d,s) option remember;
      local t,r;
      if d = 1 then
        if s >= 1 and s <= 9 then {s}
        else {}
        fi
      else
        `union`(seq(map(t -> 10*t+r, procname(d-1,s-r)), r=0..min(s,9)))
      fi
    end proc:
    `union`(seq(select(isprime,F(i,i)), i = remove(d -> d mod 3 = 0, [$1..8]));
    # if using Maple 11 or earlier, uncomment the next line
    # sort(convert(%,list)); # Robert Israel, May 05 2015
  • Mathematica
    Do[p = Prime[n]; If[ Apply[ Plus, IntegerDigits[p]] == Floor[ Log[10, p] + 1], Print[p]], {n, 1, 10^5}]
  • Python
    from itertools import count, islice
    from collections import Counter
    from sympy.utilities.iterables import partitions, multiset_permutations
    from sympy import isprime
    def A069710_gen(): # generator of terms
        for l in count(1):
            for i in range(1,min(9,l)+1):
                yield from sorted(q for q in (int(str(i)+''.join(map(str,j))) for s,p in partitions(l-i,k=9,size=True) for j in multiset_permutations([0]*(l-1-s)+list(Counter(p).elements()))) if isprime(q))
    A069710_list = list(islice(A069710_gen(),30)) # Chai Wah Wu, Nov 28 2023

Extensions

Edited and extended by Robert G. Wilson v, Apr 12 2002

A069711 Squares whose arithmetic mean of digits is an integer (i.e., the sum of digits is a multiple of the number of digits).

Original entry on oeis.org

0, 1, 4, 9, 64, 144, 225, 324, 441, 576, 729, 900, 1681, 3364, 3481, 4624, 7225, 9025, 12769, 14884, 21025, 23104, 24649, 24964, 27556, 30976, 32041, 33856, 36100, 37249, 37636, 44944, 48841, 56644, 63001, 65536, 66049, 70756, 75076, 75625, 80089, 80656, 85264
Offset: 1

Views

Author

Amarnath Murthy, Apr 08 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Do[ If[ IntegerQ[ Apply[ Plus, IntegerDigits[n^2]] / Floor[ Log[10, n^2] + 1]], Print[n^2]], {n, 1, 10^3}]

Extensions

Edited and extended by Robert G. Wilson v, Apr 12 2002
0 prepended as a(1) and a(27)-a(43) from Jon E. Schoenfield, Jun 28 2018

A069709 Primes with arithmetic mean of digits an integer (sum of digits = a multiple of number of digits).

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 31, 37, 53, 59, 71, 73, 79, 97, 1021, 1061, 1069, 1087, 1151, 1201, 1223, 1249, 1289, 1429, 1447, 1483, 1487, 1511, 1559, 1601, 1609, 1627, 1663, 1667, 1753, 1847, 1861, 1933, 1951, 1973, 1999, 2011, 2099, 2141, 2213, 2239, 2293
Offset: 1

Views

Author

Amarnath Murthy, Apr 08 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Do[p = Prime[n]; If[ IntegerQ[ Apply[ Plus, IntegerDigits[p]] / Floor[ Log[10, p] + 1]], Print[p]], {n, 1, 10^3}]
    Select[Prime[Range[400]],IntegerQ[Mean[IntegerDigits[#]]]&] (* Harvey P. Dale, Jan 29 2012 *)

Extensions

Edited and extended by Robert G. Wilson v, Apr 12 2002
Showing 1-3 of 3 results.