The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A249740 The largest prime whose square divides n, 1 if n is squarefree. 6
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
A249739 gives the corresponding smallest prime.
LINKS
FORMULA
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)).
a(n) = A006530(A003557(n)). - Amiram Eldar, Feb 11 2021
MATHEMATICA
a[n_] := If[(f = Select[FactorInteger[n], Last[#] > 1 &]) == {}, 1, f[[-1, 1]]]; Array[a, 100] (* Amiram Eldar, Feb 11 2021 *)
Table[If[SquareFreeQ[n], 1, Select[FactorInteger[n], #[[2]]>1&][[-1, 1]]], {n, 120}] (* Harvey P. Dale, Feb 28 2021 *)
PROG
(Scheme)
(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)))))))
;; Alternative version which is based on the given recurrence, and utilizes the memoizing definec-macro from Antti Karttunen's IntSeq-library:
(definec (A249740 n) (cond ((= n 1) n) ((zero? (A241917 n)) (A006530 n)) (else (A249740 (A052126 n)))))
CROSSREFS
Differs from A071773 and A249739 for the first time at n=36, where a(36) = 3, while A249739(36) = 2 and A071773(36) = 6.
Sequence in context: A205792 A370784 A249739 * A071773 A308993 A000188
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 04 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 4 06:06 EDT 2024. Contains 373089 sequences. (Running on oeis4.)