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.

A361751 a(n) is the number of decimal digits in A098129(n) and A300517(n).

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 45, 65, 87, 111, 137, 165, 195, 227, 261, 297, 335, 375, 417, 461, 507, 555, 605, 657, 711, 767, 825, 885, 947, 1011, 1077, 1145, 1215, 1287, 1361, 1437, 1515, 1595, 1677, 1761, 1847, 1935, 2025, 2117, 2211, 2307, 2405, 2505, 2607, 2711, 2817, 2925
Offset: 1

Views

Author

David Cleaver, Mar 23 2023

Keywords

Examples

			For n = 4, a(4) = 10, because A098129(4) = 1223334444.
For n = 10, a(10) = 65, because A098129(10) = 12233344445555566666677777778888888899999999910101010101010101010.
		

Crossrefs

Partial sums of A110803.

Programs

  • Maple
    a:= proc(n) a(n):= `if`(n<1, 0, a(n-1)+n*length(n)) end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 23 2023
  • PARI
    a(n) = {my(x=logint(n,10)+1);x*n*(n+1)/2 - ((100^x-1)/99 - (10^x-1)/9)/2}
    vector(100, i, a(i))
    
  • Python
    def a(n):
        d = len(str(n))
        m = 10**d
        return d*n*(n+1)//2 - ((m-11)*m + 10)//198
    print([a(n) for n in range(1, 55)]) # Michael S. Branicky, Mar 24 2023 modified Mar 29 2023
    
  • Python
    # faster for generating initial segment of sequence
    from itertools import count, islice
    def agen(s=0): yield from (s:=s+n*len(str(n)) for n in count(1))
    print(list(islice(agen(), 60))) # Michael S. Branicky, Mar 24 2023

Formula

a(n) = A055642(A098129(n)).
From Alois P. Heinz, Mar 23 2023: (Start)
a(n) = Sum_{j=1..n} j*A055642(j).
a(n) = Sum_{j=1..n} A110803(j). (End)
a(n) = Sum_{k=0..floor(log_10(n))} (n*(n+1) - 10^k*(10^k-1))/2. - Andrew Howroyd, Mar 24 2023
a(n) = k*n*(n+1)/2 - ((100^k-1)/99 - (10^k-1)/9)/2, where k = floor(log_10(n))+1. - David Cleaver, Mar 25 2023