login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A328458
Maximum run-length of the nontrivial divisors (greater than 1 and less than n) of n.
4
1, 0, 0, 1, 0, 2, 0, 1, 1, 1, 0, 3, 0, 1, 1, 1, 0, 2, 0, 2, 1, 1, 0, 3, 1, 1, 1, 1, 0, 2, 0, 1, 1, 1, 1, 3, 0, 1, 1, 2, 0, 2, 0, 1, 1, 1, 0, 3, 1, 1, 1, 1, 0, 2, 1, 2, 1, 1, 0, 5, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 0, 3, 0, 1, 1, 1, 1, 2, 0, 2, 1, 1, 0, 3, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 3, 0, 1, 1, 2, 0, 2, 0, 1, 1
OFFSET
1,6
COMMENTS
By convention, a(1) = 1, and a(p) = 0 for p prime.
LINKS
EXAMPLE
The non-singleton runs of the nontrivial divisors of 1260 are: {2,3,4,5,6,7} {9,10} {14,15} {20,21} {35,36}, so a(1260) = 6.
MATHEMATICA
Table[Switch[n, 1, 1, _?PrimeQ, 0, _, Max@@Length/@Split[DeleteCases[Divisors[n], 1|n], #2==#1+1&]], {n, 100}]
PROG
(PARI) A328458(n) = if(1==n, n, my(rl=0, pd=0, m=0); fordiv(n, d, if(1<d && d<n, if(d>(1+pd), m = max(m, rl); rl=0); pd=d; rl++)); max(m, rl)); \\ Antti Karttunen, Feb 23 2023
CROSSREFS
Positions of first appearances are A328459.
Positions of 0's and 1's are A088723.
The version that looks at all divisors is A055874.
The number of successive pairs of divisors > 1 of n is A088722(n).
The Heinz number of the multiset of run-lengths of divisors of n is A328166(n).
Sequence in context: A317531 A074169 A363859 * A099362 A321378 A307039
KEYWORD
nonn
AUTHOR
Gus Wiseman, Oct 17 2019
EXTENSIONS
Data section extended up to a(105) by Antti Karttunen, Feb 23 2023
STATUS
approved