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.

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

A300517 a(n) is the concatenation of n n times, n-1 n-1 times, ..., 22, 1.

Original entry on oeis.org

1, 221, 333221, 4444333221, 555554444333221, 666666555554444333221, 7777777666666555554444333221, 888888887777777666666555554444333221, 999999999888888887777777666666555554444333221, 10101010101010101010999999999888888887777777666666555554444333221
Offset: 1

Views

Author

Seiichi Manyama, Mar 07 2018

Keywords

Comments

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

Examples

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

Crossrefs

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

Programs

  • Maple
    a:= n-> parse(cat(seq((n-i)$(n-i), i=0..n-1))):
    seq(a(n), n=1..12);  # Alois P. Heinz, Mar 07 2018
  • PARI
    a(n) = {my(a=0, b=0, d=1, i);
      for(i=1, n, b = logint(i, 10)+1;
        a += d*i*(10^(i*b)-1)/(10^b-1);
        d *= 10^(i*b); ); return(a); } \\ David Cleaver, Apr 14 2023
  • Ruby
    def A300517(n)
      a = '1'
      [1] + (2..n).map{|i| a = (i.to_s * i + a.to_s).to_i}
    end
    p A300517(20)
    
Showing 1-2 of 2 results.