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

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

A098129 Concatenate 1 once, 2 twice, 3 three times, up to n n times.

Original entry on oeis.org

1, 122, 122333, 1223334444, 122333444455555, 122333444455555666666, 1223334444555556666667777777, 122333444455555666666777777788888888, 122333444455555666666777777788888888999999999
Offset: 1

Views

Author

Michael Joseph Halm, Jan 04 2005

Keywords

Comments

a(n) is composite for all 2 <= n <= 1000. - David Cleaver, Mar 22 2023

Examples

			a(4) = 1223334444 because 1 concatenated once then concatenated with 2 twice and 3 three times and 4 four times gives 1223334444.
		

Crossrefs

Cf. A000461, A300517, A361751 (number of decimal digits).

Programs

  • Maple
    a:= n-> parse(cat(seq(i$i, i=1..n))):
    seq(a(n), n=1..12);  # Alois P. Heinz, Mar 07 2018
  • Mathematica
    nn = 12; a[0] = {}; Do[Set[a[n], Join[a[n - 1], Flatten@ ConstantArray[IntegerDigits[n], n]]], {n, nn}]; Array[FromDigits @* a, nn] (* Michael De Vlieger, Mar 29 2023 *)
  • PARI
    a(n) = {my(a=0,i,k);
      for(i=1,n, k = logint(i,10)+1;
        a = a*10^(i*k) + i*(10^(i*k)-1)/(10^k-1);
    ); return(a); } \\ David Cleaver, Mar 29 2023
    
  • Python
    def A098129(n): return int(''.join(str(j)*j for j in range(1,n+1))) # Chai Wah Wu, Mar 29 2023

Extensions

Offset and a(8) corrected by Seiichi Manyama, Mar 07 2018

A300558 a(n) is the concatenation n written in base 2 n times, n-1 written in base 2 n-1 times, ..., 1 written in base 2 once.

Original entry on oeis.org

1, 10101, 11111110101, 10010010010011111110101, 10110110110110110010010010011111110101, 11011011011011011010110110110110110010010010011111110101, 11111111111111111111111011011011011011010110110110110110010010010011111110101
Offset: 1

Views

Author

Seiichi Manyama, Mar 08 2018

Keywords

Crossrefs

Programs

  • Ruby
    def A300558(n)
      a = '1'
      [1] + (2..n).map{|i| a = (i.to_s(2) * i + a.to_s).to_i}
    end
    p A300558(10)
Showing 1-3 of 3 results.