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.

A365740 Length of the longest subsequence of {m: 1<=m<=n, m not prime} on which the Euler totient function phi A000010 is nondecreasing.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 4, 5, 5, 5, 6, 6, 7, 8, 9, 9, 9, 9, 10, 11, 11, 11, 11, 12, 12, 13, 13, 13, 13, 13, 14, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 20, 20, 21, 21, 21, 21, 21, 22, 23, 23, 24, 24, 24, 24, 25, 25
Offset: 1

Views

Author

Chai Wah Wu, Sep 17 2023

Keywords

Crossrefs

Programs

  • Python
    from bisect import bisect
    from sympy import totient, isprime
    def A365740(n):
        plist = tuple(totient(i) for i in range(1,n+1) if not isprime(i))
        m = len(plist)
        qlist, c = [0]*(m+1), 0
        for i in range(m):
            qlist[a:=bisect(qlist,plist[i],lo=1,hi=c+1,key=lambda x:plist[x])]=i
            c = max(c,a)
        return c

Formula

Pollack et al. conjectured that a(n) < A365339(n)-2 for all n >= 31957.