login
a(0) = 0, a(1) = 1; for n>1, if a(n-1) is composite then a(n) = a(n-1)/A107286(n-1), where A107286(n) = the smallest prime factor of n, otherwise a(n) = a(n-1) + n.
1

%I #16 Oct 12 2020 15:44:27

%S 0,1,3,6,3,8,4,2,10,5,15,5,17,30,15,5,21,7,25,5,25,5,27,9,3,28,14,7,

%T 35,7,37,68,34,17,51,17,53,90,45,15,5,46,23,66,33,11,57,19,67,116,58,

%U 29,81,27,9,3,59,116,58,29,89,150,75,25,5,70,35,7,75,25,5,76,38,19,93,31,107,184,92

%N a(0) = 0, a(1) = 1; for n>1, if a(n-1) is composite then a(n) = a(n-1)/A107286(n-1), where A107286(n) = the smallest prime factor of n, otherwise a(n) = a(n-1) + n.

%C The sequence can only increase for two consecutive terms at most as if a(n) is even then a(n+1) will be a(n)/2, while if a(n) is odd and a(n+1) is prime then a(n+2) will be even and thus a(n+3) = a(n+2)/2.

%C For the first 100 million terms the lowest number not to have appeared is 888. It is likely all numbers eventually appear although this is unknown.

%H Scott R. Shannon, <a href="/A337903/a337903.png">Graph of the first 10 million terms</a>.

%e a(3) = 6 as a(2) = 3 which is prime thus a(3) = 3 + 3 = 6.

%e a(4) = 3 as a(3) = 6 which has the smallest divisor 2 thus a(4) = 6/2 = 3.

%e a(11) = 5 as a(10) = 15 which has the smallest divisor 3 thus a(11) = 15/3 = 5.

%t a[0] = 0; a[1] = 1; a[n_] := a[n] = If[CompositeQ[a[n - 1]], a[n - 1]/FactorInteger[a[n - 1]][[1, 1]], a[n - 1] + n]; Array[a, 100, 0] (* _Amiram Eldar_, Sep 30 2020 *)

%Y Cf. A107286, A064413, A098550, A336957, A330252.

%K nonn

%O 0,3

%A _Scott R. Shannon_, Sep 29 2020