login
A333995
a(n) = number of distinct composite numbers in the n X n multiplication table that are not in the n-1 X n-1 multiplication table.
4
0, 1, 2, 3, 4, 4, 6, 5, 6, 6, 10, 6, 12, 8, 9, 8, 16, 9, 18, 10, 12, 12, 22, 10, 16, 14, 15, 13, 28, 12, 30, 15, 18, 18, 20, 13, 36, 20, 21, 16, 40, 17, 42, 20, 21, 24, 46, 17, 31, 22, 27, 23, 52, 22, 31, 22, 30, 30, 58, 19, 60, 32, 28, 26, 36, 26, 66, 30, 36
OFFSET
1,3
COMMENTS
From Charles Kusniec, Jun 23 2026: (Start)
Equivalently, a(n) counts the composite products n*k, 1 <= k <= n, such that A033677(n*k) = n. These are the composite primitive entries of column n in the triangular multiplication table.
For prime p, a(p) = p-1, since all products p*k, 1 <= k <= p, first appear in column p; the term p itself is prime and therefore is not counted by a(n).
Apart from the initial exceptional record at n = 4, the record values of a(n) occur at n = prime.
For n > 1, a(n) + A010051(n) is the length of row n of A397409. Because a(p) + A010051(p) = p, every prime p is a record position of this row-length sequence. (End)
FORMULA
a(n) = n - A108407(n-1) - A010051(n), n > 1. - Corrected by R. J. Mathar, Oct 02 2020
a(n) = A062854(n) - A010051(n) for n > 1. - Chai Wah Wu, Oct 14 2023
EXAMPLE
a(2) = 1 since the 1 X 1 and 2 X 2 multiplication tables are
---
1
---
2 4
1 2
---
and the composite number 4 has appeared.
---
a(8)=5:
64*
49 56*
36 42 48*
25 30 35 40*
16 20 24 28 32*
9 12 15 18 21 24
4 6 8 10 12 14 16
1 2 3 4 5 6 7 8
MATHEMATICA
a[n_] := Sum[Boole[AllTrue[Select[Divisors[n*k], # < n &], # <= k &]], {k, 1, n}] - Boole[PrimeQ[n]]; a[1] = 0; Array[a, 70] (* Amiram Eldar, Jun 27 2026 *)
PROG
(Python)
from itertools import takewhile
from sympy import divisors, isprime
def A333995(n): return sum(1 for i in range(1, n+1) if all(d<=i for d in takewhile(lambda d:d<n, divisors(n*i))))-int(isprime(n)) if n>1 else 0 # Chai Wah Wu, Oct 14 2023
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Charles Kusniec, Sep 05 2020
STATUS
approved