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.

A297217 Most common value of the number of divisors function among all composites up to composite(n) inclusive, or 0 if there is a tie.

Original entry on oeis.org

3, 0, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Offset: 1

Views

Author

Felix Fröhlich, Mar 02 2018

Keywords

Comments

Is a(n) = 4 for all n > 4?

Examples

			          n  |  1 |  2 |  3 |  4 |  5 |  6 |  7 |  8 |  9 | 10 | 11 | 12
-------------------------------------------------------------------------
  A002808(n) |  4 |  6 |  8 |  9 | 10 | 12 | 14 | 15 | 16 | 18 | 20 | 21
-------------------------------------------------------------------------
A035004(n+1) |  3 |  4 |  4 |  3 |  4 |  6 |  4 |  4 |  5 |  6 |  6 |  4
-------------------------------------------------------------------------
        a(n) |  3 |  0 |  4 |  0 |  4 |  4 |  4 |  4 |  4 |  4 |  4 |  4
		

Crossrefs

Programs

  • PARI
    composite(n) = my(i=0); forcomposite(c=1, , i++; if(i==n, return(c)))
    mcv(v) = my(w=vecsort(v, , 8), count=vector(#w), ind=0, i=0); for(x=1, #w, for(y=1, #v, if(w[x]==v[y], count[x]++))); for(k=1, #count, if(count[k]==vecmax(count), ind=k; i++)); if(i > 1, return(0), return(w[ind]))
    a(n) = my(v=[]); for(k=1, n, v=concat(v, numdiv(composite(k)))); mcv(v)