|
|
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
|
|
|
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:
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|