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 A249740 #16 Feb 28 2021 16:12:34 %S A249740 1,1,1,2,1,1,1,2,3,1,1,2,1,1,1,2,1,3,1,2,1,1,1,2,5,1,3,2,1,1,1,2,1,1, %T A249740 1,3,1,1,1,2,1,1,1,2,3,1,1,2,7,5,1,2,1,3,1,2,1,1,1,2,1,1,3,2,1,1,1,2, %U A249740 1,1,1,3,1,1,5,2,1,1,1,2,3,1,1,2,1,1,1,2,1,3,1,2,1,1,1,2,1,7,3,5,1,1,1,2,1,1,1,3,1,1,1,2,1,1,1,2,3,1,1,2 %N A249740 The largest prime whose square divides n, 1 if n is squarefree. %C A249740 A249739 gives the corresponding smallest prime. %H A249740 Antti Karttunen, <a href="/A249740/b249740.txt">Table of n, a(n) for n = 1..10000</a> %F A249740 a(1) = 1, and for n > 1, if A241917(n) = 0 [i.e., n is a term of A070003], a(n) = A006530(n), otherwise a(n) = a(A052126(n)). %F A249740 a(n) = A006530(A003557(n)). - _Amiram Eldar_, Feb 11 2021 %t A249740 a[n_] := If[(f = Select[FactorInteger[n], Last[#] > 1 &]) == {}, 1, f[[-1, 1]]]; Array[a, 100] (* _Amiram Eldar_, Feb 11 2021 *) %t A249740 Table[If[SquareFreeQ[n],1,Select[FactorInteger[n],#[[2]]>1&][[-1,1]]],{n,120}] (* _Harvey P. Dale_, Feb 28 2021 *) %o A249740 (Scheme) %o A249740 (define (A249740 n) (let loop ((n n) (p (A006530 n))) (cond ((= 1 n) n) ((zero? (modulo n (* p p))) p) (else (loop (/ n p) (A006530 (/ n p))))))) %o A249740 ;; Alternative version which is based on the given recurrence, and utilizes the memoizing definec-macro from _Antti Karttunen_'s IntSeq-library: %o A249740 (definec (A249740 n) (cond ((= n 1) n) ((zero? (A241917 n)) (A006530 n)) (else (A249740 (A052126 n))))) %Y A249740 Cf. A003557, A005117, A013929, A006530, A052126, A070003, A241917, A249718. %Y A249740 Differs from A071773 and A249739 for the first time at n=36, where a(36) = 3, while A249739(36) = 2 and A071773(36) = 6. %K A249740 nonn %O A249740 1,4 %A A249740 _Antti Karttunen_, Nov 04 2014