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.

A222085 Sum of the least divisors of n whose LCM is equal to n.

This page as a plain text file.
%I A222085 #29 Nov 05 2019 06:52:48
%S A222085 1,3,4,7,6,6,8,15,13,8,12,10,14,10,9,31,18,21,20,12,11,14,24,24,31,16,
%T A222085 40,14,30,11,32,63,15,20,13,25,38,22,17,20,42,19,44,18,18,26,48,52,57,
%U A222085 43,21,20,54,66,17,22,23,32,60,15,62,34,20,127,19,23,68
%N A222085 Sum of the least divisors of n whose LCM is equal to n.
%H A222085 Amiram Eldar, <a href="/A222085/b222085.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Paolo P. Lava)
%e A222085 The divisors of 20 are 1, 2, 4, 5, 10, 20 while the least divisors of 20 whose LCM is equal to 20 are 1, 2, 4, 5. Then a(20) = 1+2+4+5 = 12.
%p A222085 with(numtheory);
%p A222085 A222085:=proc(q)
%p A222085 local a,b,c,j,n,v; print(1);
%p A222085 for n from 2 to q do a:=ifactors(n)[2]; b:=nops(a); c:=0;
%p A222085   for j from 1 to b do if a[j][1]^a[j][2]>c then c:=a[j][1]^a[j][2]; fi; od;
%p A222085   a:=op(sort([op(divisors(n))])); b:=nops(divisors(n)); v:=0;
%p A222085   for j from 1 to b do v:=v+a[j]; if a[j]=c then break; fi; od; print(v);
%p A222085 od; end:
%p A222085 A222085(100000000);
%t A222085 s[n_] := Module[{sum=0, L=1}, Do[sum+=d; L = LCM[L, d]; If[L == n, Break[]], {d, Divisors[n]}]; sum]; Array[s, 67] (* _Amiram Eldar_, Nov 05 2019 *)
%o A222085 (PARI) a(n)=my(s,L=1);fordiv(n,d,s+=d;L=lcm(L,d);if(L==n,return(s))) \\ _Charles R Greathouse IV_, Feb 14 2013
%Y A222085 Cf. A000005, A000961, A001358, A003418, A005179, A024619, A034444, A077610, A222084.
%K A222085 nonn
%O A222085 1,2
%A A222085 _Paolo P. Lava_, Feb 11 2013