cp's OEIS Frontend

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.

A066574 LCM of numbers <= n and having a factor in common with n.

This page as a plain text file.
%I A066574 #7 Feb 23 2019 21:34:00
%S A066574 1,2,3,4,5,12,7,24,18,120,11,360,13,840,180,1680,17,5040,19,5040,1260,
%T A066574 55440,23,55440,300,720720,7560,720720,29,10810800,31,1441440,83160,
%U A066574 24504480,2100,73513440,37,465585120,1081080,2327925600,41,1396755360
%N A066574 LCM of numbers <= n and having a factor in common with n.
%C A066574 If n is not composite then a(n) = n.
%e A066574 a(6) = 12 since lcm{ 1,2,3,4,6 } = 12.
%p A066574 A066574 := n -> ilcm(op(select(k->igcd(n,k)<>1,[$1..n]))); seq(A066574(i),i=1..42); # _Peter Luschny_, Jun 25 2011
%t A066574 f[n_] := Block[{a = 1, k = 2}, While[k < n + 1, If[ GCD[k, n] > 1, a = LCM[a, k]]; k++ ]; Return[a]]; Table[ f[n], {n, 1, 45} ]
%K A066574 nonn
%O A066574 1,2
%A A066574 _Amarnath Murthy_, Dec 19 2001
%E A066574 More terms from _Robert G. Wilson v_, Dec 26 2001