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.

A244191 a(n) = most common final digit for a prime < 10^n, or 0 if there is a tie.

Original entry on oeis.org

0, 3, 7, 3, 7, 3, 3, 7, 3, 3, 7, 7, 3, 3
Offset: 1

Views

Author

Derek Orr, Jun 22 2014

Keywords

Examples

			For all 25 primes < 100 (10^2), we see that the last digit that appears the most is 3. Thus a(2) = 3.
		

Crossrefs

Programs

  • Python
    import sympy
    from sympy import isprime
    def prend(d,n):
      lst = []
      for k in range(10**n):
        if isprime(k):
          lst.append((k%10**d))
      new = 0
      newlst = []
      for i in range(10**(d-1),10**d):
        new = lst.count(i)
        newlst.append(new)
      newlst1 = newlst.copy()
      a = max(newlst1)
      newlst1[newlst1.index(a)] = 0
      b = max(newlst1)
      if a == b:
        return 0
      else:
        return newlst.index(max(a,b)) + 10**(d-1)
    n = 2
    while n < 10:
      print(prend(1,n),end=', ')
      n += 1

Extensions

a(9)-a(14) from Hiroaki Yamanouchi, Sep 27 2014