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.

A365398 Length of the longest subsequence of 1, ..., n on which sigma, the sum of the divisors of n (A000203), is nondecreasing.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Sep 08 2023

Keywords

Comments

The sequence was inspired by A365339. In particular, note remark (4.4) by Terence Tao in the linked paper.

Crossrefs

Programs

  • Python
    from bisect import bisect
    from sympy import divisor_sigma
    def A365398(n):
        plist, qlist, c = tuple(divisor_sigma(i) for i in range(1,n+1)), [0]*(n+1), 0
        for i in range(n):
            qlist[a:=bisect(qlist,plist[i],lo=1,hi=c+1,key=lambda x:plist[x])]=i
            c = max(c,a)
        return c # Chai Wah Wu, Sep 08 2023

Formula

a(n+1) - a(n) <= 1.
a(n) >= A000720(n)+1 since A000203(p) = p+1 for p prime. - Chai Wah Wu, Sep 08 2023

A385991 a(n) is the number of distinct values among A002487(0), ..., A002487(n).

Original entry on oeis.org

1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 16
Offset: 0

Views

Author

Rémy Sigrist, Jul 14 2025

Keywords

Comments

This sequence exhibits large runs of consecutive equal values.

Examples

			Sequence begins:
  n   a(n)  A002487(n)
  --  ----  ----------
   0     1           0
   1     2           1
   2     2           1
   3     3           2
   4     3           1
   5     4           3
   6     4           2
   7     4           3
   8     4           1
   9     5           4
  10     5           3
  11     6           5
  12     6           2
  13     6           5
  14     6           3
  15     6           4
  16     6           1
  17     6           5
  18     6           4
  19     7           7
		

Crossrefs

See A061069, A061070 and A061071 for similar sequences.

Programs

  • PARI
    \\ See Links section.
    
  • Python
    def A385991(n):
        if n==0: return 1
        a, b, s, c = 0, 1, {0,1}, 2
        for i in range(n-1):
            a, b = b, ((a//b<<1)+1)*b-a
            if b not in s:
                c += 1
                s.add(b)
        return c # Chai Wah Wu, Jul 17 2025

Formula

a(A091945(n)) = n (this is the first occurrence of n in the sequence).
a(2*n) = a(2*n-1) for any n > 0.
Showing 1-2 of 2 results.