This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A055874 #69 Jan 14 2024 06:54:59 %S A055874 1,2,1,2,1,3,1,2,1,2,1,4,1,2,1,2,1,3,1,2,1,2,1,4,1,2,1,2,1,3,1,2,1,2, %T A055874 1,4,1,2,1,2,1,3,1,2,1,2,1,4,1,2,1,2,1,3,1,2,1,2,1,6,1,2,1,2,1,3,1,2, %U A055874 1,2,1,4,1,2,1,2,1,3,1,2,1,2,1,4,1,2,1,2,1,3,1,2,1,2,1,4,1,2,1,2 %N A055874 a(n) = largest m such that 1, 2, ..., m divide n. %C A055874 From _Antti Karttunen_, Nov 20 2013 & Jan 26 2014: (Start) %C A055874 Differs from A232098 for the first time at n=840, where a(840)=8, while A232098(840)=7. A232099 gives all the differing positions. See also the comments at A055926 and A232099. %C A055874 The positions where a(n) is an odd prime is given by A017593 up to A017593(34)=414 (so far all 3's), after which comes the first 7 at a(420). (A017593 gives the positions of 3's.) %C A055874 (Continued on Jan 26 2014): %C A055874 Only terms of A181062 occur as values. %C A055874 A235921 gives such n where a(n^2) (= A235918(n)) differs from A071222(n-1) (= A053669(n)-1). (End) %C A055874 a(n) is the largest m such that A003418(m) divides n. - _David W. Wilson_, Nov 20 2014 %C A055874 a(n) is the largest number of consecutive integers dividing n. - _David W. Wilson_, Nov 20 2014 %C A055874 A051451 gives indices where record values occur. - _Gionata Neri_, Oct 17 2015 %C A055874 Yuri Matiyasevich calls this the maximum inheritable divisor of n. - _N. J. A. Sloane_, Dec 14 2023 %H A055874 Antti Karttunen, <a href="/A055874/b055874.txt">Table of n, a(n) for n = 1..10080</a> %H A055874 Bakir Farhi, <a href="https://www.emis.de/journals/INTEGERS/papers/j42/j42.Abstract.html">On the average asymptotic behavior of a certain type of sequences of integers</a>, Integers, Vol. 9 (2009), pp. 555-567. %F A055874 a(n) = A007978(n) - 1. - _Antti Karttunen_, Jan 26 2014 %F A055874 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A064859 (Farhi, 2009). - _Amiram Eldar_, Jul 25 2022 %e A055874 a(12) = 4 because 1, 2, 3, 4 divide 12, but 5 does not. %p A055874 N:= 1000: # to get a(1) to a(N) %p A055874 A:= Vector(N,1); %p A055874 for m from 2 do %p A055874 Lm:= ilcm($1..m); %p A055874 if Lm > N then break fi; %p A055874 if Lm mod (m+1) = 0 then next fi; %p A055874 for k from 1 to floor(N/Lm) do %p A055874 A[k*Lm]:=m %p A055874 od %p A055874 od: %p A055874 convert(A,list); # _Robert Israel_, Nov 28 2014 %t A055874 a[n_] := Module[{m = 1}, While[Divisible[n, m++]]; m - 2]; Array[a, 100] (* _Jean-François Alcover_, Mar 07 2016 *) %o A055874 (Haskell) %o A055874 a055874 n = length $ takeWhile ((== 0) . (mod n)) [1..] %o A055874 -- _Reinhard Zumkeller_, Feb 21 2012, Dec 09 2010 %o A055874 (Scheme) %o A055874 (define (A055874 n) (let loop ((m 1)) (if (not (zero? (modulo n m))) (- m 1) (loop (+ 1 m))))) ;; _Antti Karttunen_, Nov 18 2013 %o A055874 (PARI) a(n) = my(m = 1); while ((n % m) == 0, m++); m - 1; \\ _Michel Marcus_, Jan 17 2014 %o A055874 (Python) %o A055874 from itertools import count %o A055874 def A055874(n): %o A055874 for m in count(1): %o A055874 if n % m: %o A055874 return m-1 # _Chai Wah Wu_, Jan 02 2022 %Y A055874 One less than A007978. %Y A055874 Cf. also A053669, A055881, A055926, A017593, A064859, A181062, A126800, A232098, A232099, A233284, A235918, A235921. %K A055874 easy,nonn %O A055874 1,2 %A A055874 _Leroy Quet_, Jul 16 2000