|
|
A249740
|
|
The largest prime whose square divides n, 1 if n is squarefree.
|
|
5
|
|
|
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
|
Antti Karttunen, Table of n, a(n) for n = 1..10000
|
|
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
|
Cf. A003557, A005117, A013929, A006530, A052126, A070003, A241917, A249718.
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: A285718 A205792 A249739 * A071773 A308993 A000188
Adjacent sequences: A249737 A249738 A249739 * A249741 A249742 A249743
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
Antti Karttunen, Nov 04 2014
|
|
STATUS
|
approved
|
|
|
|