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.

A340261 T(n, k) is the number of integers that are less than or equal to k that do not divide n. Triangle read by rows, for 0 <= k <= n.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 2, 3, 3, 0, 0, 0, 1, 2, 2, 0, 1, 2, 3, 4, 5, 5, 0, 0, 1, 1, 2, 3, 4, 4, 0, 1, 1, 2, 3, 4, 5, 6, 6, 0, 0, 1, 2, 2, 3, 4, 5, 6, 6, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 6, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11
Offset: 1

Views

Author

Peter Luschny, Jan 02 2021

Keywords

Examples

			Table starts:
                            [1] 0;
                           [2] 0, 0;
                          [3] 0, 1, 1;
                        [4] 0, 0, 1, 1;
                       [5] 0, 1, 2, 3, 3;
                     [6] 0, 0, 0, 1, 2, 2;
                    [7] 0, 1, 2, 3, 4, 5, 5;
                  [8] 0, 0, 1, 1, 2, 3, 4, 4;
                 [9] 0, 1, 1, 2, 3, 4, 5, 6, 6;
               [10] 0, 0, 1, 2, 2, 3, 4, 5, 6, 6;
		

Crossrefs

T(n, n) = n - tau(n) = A049820(n).
T(2*n, n) = n + 1 - tau(2*n) = A234306(n).

Programs

  • Maple
    IversonBrackets := expr -> subs(true=1, false=0, evalb(expr)):
    T := (n, k) -> add(IversonBrackets(irem(n, j) <> 0), j = 1..k):
    # Alternative:
    T := (n, k) -> nops({seq(j, j = 1..k)} minus numtheory:-divisors(n)):
    for n from 1 to 19 do seq(T(n, k), k = 1..n) od;

Formula

T(n, k) = Sum_{j=1..k} [n mod j <> 0], where [ ] are the Iverson brackets.
T(n, k) = card({j : j = 1..k} \ divisors(n)).