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-2 of 2 results.

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

A244267 a(n) = the frequency of the most common 2-digit ending of a prime < 10^n.

Original entry on oeis.org

1, 6, 35, 250, 1986, 16716, 144183, 1271765, 11378311, 102956670, 940224567, 8651691637, 80123673992
Offset: 2

Views

Author

Derek Orr, Jun 24 2014

Keywords

Examples

			Of the primes up to and including the last of the 3-digit primes, the most common 2-digit ending occurs 6 times. Thus a(3) = 6.
		

Crossrefs

Cf. A244192.

Programs

  • Python
    import sympy
    from sympy import isprime
    def prend1(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)
      return max(newlst)
    n = 3
    while n < 10:
      print(prend1(2,n),end=', ')
      n += 1

Extensions

a(9)-a(12) from Hiroaki Yamanouchi, Aug 26 2014
Example corrected by Harvey P. Dale, Sep 27 2018
a(13)-a(14) from Giovanni Resta, Oct 23 2018
Showing 1-2 of 2 results.