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.

A345681 a(0) = 0; for n >= 1, a(n) = A004185(a(n-1)+n).

Original entry on oeis.org

0, 1, 3, 6, 1, 6, 12, 19, 27, 36, 46, 57, 69, 28, 24, 39, 55, 27, 45, 46, 66, 78, 1, 24, 48, 37, 36, 36, 46, 57, 78, 19, 15, 48, 28, 36, 27, 46, 48, 78, 118, 159, 12, 55, 99, 144, 19, 66, 114, 136, 168, 129, 118, 117, 117, 127, 138, 159, 127, 168
Offset: 0

Views

Author

Ctibor O. Zizka, Jun 22 2021

Keywords

Examples

			a(4) = A004185(6+4) = 1; a(13) = A004185(69+13) = 28.
		

Crossrefs

Programs

  • Mathematica
    a[0] := 0;
    a[n_] := FromDigits[Sort[DeleteCases[IntegerDigits[a[n - 1] + n], 0]]];
    Table[a[n], {n, 0, 59}] (* Robert P. P. McKone, Aug 16 2021 *)
  • PARI
    f(n) = fromdigits(vecsort(digits(n))); \\ A004185
    a(n) = if (n==0, 0, f(a(n-1)+n)); \\ Michel Marcus, Jun 26 2021
    
  • PARI
    f(n) = fromdigits(vecsort(digits(n))); \\ A004185
    lista(nn) = {my(v=vector(nn)); v[1] = 1; for (n=2, nn, v[n] = f(v[n-1]+n);); concat(0, v);} \\ Michel Marcus, Jun 26 2021
  • Python
    def A004185(n): return int("".join(sorted(str(n))).strip('0'))
    def aupton(nn):
        alst = [0]
        for n in range(1, nn+1): alst.append(A004185(alst[-1]+n))
        return alst
    print(aupton(100)) # Michael S. Branicky, Jun 22 2021
    

Formula

a(9*k+0 or 8) == 0 (mod 9);
a(9*k+1 or 4 or 7) == 1 (mod 9);
a(9*k+2 or 6) == 3 (mod 9);
a(9*k+3 or 5) == 6 (mod 9).