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.
FORMULA
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
