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.

A341270 a(n) = Sum_{k=1..n} a(n mod k) for n > 0; a(0) = 1.

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 7, 10, 12, 15, 17, 25, 24, 32, 37, 45, 46, 63, 62, 82, 83, 97, 104, 141, 130, 158, 170, 201, 202, 255, 242, 302, 306, 350, 367, 448, 416, 503, 522, 610, 597, 716, 690, 825, 832, 921, 945, 1147, 1085, 1255, 1272, 1430, 1435, 1683, 1631, 1888
Offset: 0

Views

Author

Rok Cestnik, Feb 07 2021

Keywords

Examples

			a(1) = a(1 mod 1) = a(0) = 1.
a(2) = a(2 mod 1)+a(2 mod 2) = a(0)+a(0) = 2.
a(3) = a(3 mod 1)+a(3 mod 2)+a(3 mod 3) = a(0)+a(1)+a(0) = 3.
		

Crossrefs

For Sum_{k=1..n} n mod k see A004125.
For Sum_{k=1..n} a(k) see A000079.
For Max_{k=1..n} a(n mod k)+1 see A113473.

Programs

  • Maple
    a:= proc(n) option remember;
         `if`(n=0, 1, add(a(n mod k), k=1..n))
        end:
    seq(a(n), n=0..62);  # Alois P. Heinz, Feb 07 2021
  • Mathematica
    a[0] = 1; a[n_] := a[n] = Sum[a[Mod[n, k]], {k, 1, n}]; Array[a, 50, 0] (* Amiram Eldar, Feb 08 2021 *)
  • PARI
    a(n) = if (n==0, 1, sum(k=1, n, a(n % k))); \\ Michel Marcus, Feb 08 2021
  • Python
    a = [1]
    for n in range(1,1000):
        a.append(sum(a[n%k] for k in range(1,n+1)))