A328458 Maximum run-length of the nontrivial divisors (greater than 1 and less than n) of n.
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
Keywords
Examples
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.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..100000
Crossrefs
Programs
-
Mathematica
Table[Switch[n,1,1,?PrimeQ,0,,Max@@Length/@Split[DeleteCases[Divisors[n],1|n],#2==#1+1&]],{n,100}]
-
PARI
A328458(n) = if(1==n,n,my(rl=0,pd=0,m=0); fordiv(n, d, if(1
(1+pd), m = max(m,rl); rl=0); pd=d; rl++)); max(m,rl)); \\ Antti Karttunen, Feb 23 2023
Extensions
Data section extended up to a(105) by Antti Karttunen, Feb 23 2023
Comments