%I #20 Mar 30 2019 15:57:42
%S 6,38,42,62,146,1145,4214,15590,47058,121935,464834,4049465,4759314,
%T 7756755,15838490,18284105,127137997,132734042,141393578,353493351,
%U 435485242,470458377,1056410914
%N Numbers that can be expressed as the sum of their first k consecutive arithmetic derivatives for some k > 1.
%C If k = 1 is allowed, then numbers of the form p^p also occur, where p is prime. These are the terms of A051674. - _T. D. Noe_, Dec 27 2012
%e 6’=5; 5’=1; 6=5+1 (k=2);
%e 38’=21; 21’=10; 10’=7; 38=21+10+7 (k=3);
%e 42’=41; 41’=1; 42=41+1 (k=2);
%e 62’=33; 33’=14; 14’=9; 9'=6; 62=33+14+9+6 (k=4);
%e 146’=75; 75’=55; 55’=16; 146=75+55+16 (k=3);
%e 1145’=234; 234’=291; 291’=100; 100'=140; 140'=188; 188'=192; 1145=234+291+100+140+188+192 (k=6).
%p with(numtheory);
%p A216384:= proc(i)
%p local a,b,n,p,pfs;
%p for n from 1 to i do
%p pfs:=ifactors(n)[2]; a:=n*add(op(2,p)/op(1,p),p=pfs);
%p if a<n then b:=a;
%p while b<n do
%p pfs:=ifactors(a)[2]; a:=a*add(op(2,p)/op(1,p),p=pfs);
%p if a=0 then break; else b:=b+a; fi;
%p od;
%p if b=n then print(n); fi; fi; od;
%p end:
%p A216384 (10000000);
%t d[1]=0; d[n_] := n*Total[#2/#1 & @@@ FactorInteger[n]]; seqQ[n_] := Module[{s = 0, k = n}, While[s < n && k > 0, k = d[k]; s += k]; k < n && s == n]; Select[ Range[16000], seqQ] (* _Amiram Eldar_, Mar 30 2019 *)
%o (Python)
%o from sympy import factorint
%o A216384 = []
%o for n in range(1,10**5):
%o ....ndsum = nd = sum([int(n*e/p) for p,e in factorint(n).items()])
%o ....while ndsum <= n and nd > 1:
%o ........nd = sum([int(nd*e/p) for p,e in factorint(nd).items()])
%o ........ndsum += nd
%o ........if ndsum == n:
%o ............A216384.append(n)
%o # _Chai Wah Wu_, Aug 21 2014
%o (PARI) der(n) = sum(i=1, #f=factor(n)~, n/f[1, i]*f[2, i]);
%o isok(n) = {my(s = 0, kn = n, nb = 0, d); until (s == kn, d = der(n); if (d==0, return(0)); s += d; if (s > kn, return (0)); n = d; nb++;); nb > 1;} \\ _Michel Marcus_, Mar 30 2019
%Y Cf. A003415, A051674.
%K nonn,more
%O 1,1
%A _Paolo P. Lava_, Sep 06 2012
%E a(20)-a(23) from _Amiram Eldar_, Mar 30 2019
|