OFFSET
1,5
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..1000
FORMULA
For prime p, a(p-1) = 0.
a(n) = n+1 - A062854(n+1).
EXAMPLE
When going to 8 X 8, the added entries 8,16,24 are already known, so a(7)=3:
.1..2..3..4..5..6..7....8 *
....4..6..8.10.12.14...16 *
.......9.12.15.18.21...24 *
.........16.20.24.28...32
............25.30.35...40
...............36.42...48
..................49...56
.......................64
MAPLE
A108407 := proc(n)
n+1-A062854(n+1) ;
end proc:
seq(A108407(n), n=1..40) ; # R. J. Mathar, Oct 02 2020
MATHEMATICA
nmax = 100;
A062854 = Table[u = If[n == 1, {}, Union[u, n Range[n]]]; Length[u], {n, 1, nmax+1}] // Differences // Prepend[#, 1]&;
a[n_] := n + 1 - A062854[[n+1]];
Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Oct 02 2020 *)
PROG
(Python)
from itertools import takewhile
from python import divisors
def A108407(n): return n+1-sum(1 for i in range(1, n+2) if all(d<=i for d in takewhile(lambda d:d<=n, divisors((n+1)*i)))) # Chai Wah Wu, Oct 13 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Jun 03 2005
STATUS
approved