A360179 a(1) = 1. Thereafter if a(n-1) is a novel term, a(n) = d(a(n-1)); otherwise a(n) = a(n-1) + d(u), where d is the divisor function A000005 and u is the smallest unstarred prior term (each time we use a prior term we star it, and starred terms cannot be reused).
1, 1, 2, 2, 3, 2, 4, 3, 5, 2, 4, 6, 4, 6, 8, 4, 7, 2, 5, 7, 10, 4, 7, 10, 12, 6, 8, 12, 16, 5, 9, 3, 5, 7, 9, 11, 2, 4, 6, 9, 13, 2, 4, 6, 9, 13, 15, 4, 8, 11, 15, 19, 2, 5, 7, 9, 11, 14, 4, 7, 10, 12, 15, 18, 6, 10, 14, 18, 22, 4, 8, 11
Offset: 1
Examples
a(2) = 1 since a(1) = 1 is a novel term and d(1) = 1. Thus the sequence starts 1,1 and since a(2) is a repeated term, a(3) = a(2) + d(1) (1 = least unstarred prior term). Therefore a(3) = 1 + 1 = 2.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..40000 [The exceptionally large b-file was added at my request. - _N. J. A. Sloane_, Apr 07 2023]
- Michael De Vlieger, Scatterplot A of a(n), n = 1..40000.
- Michael De Vlieger, Scatterplot B of a(n) for n = 1..128. Records appear in red, local minima in blue, terms instigated by a(n) = m new to the sequence appear in gold, otherwise in green. The magenta line indicates the smallest missing number u not in a(1..n-1).
- Michael De Vlieger, Scatterplot of a(n), n = 1500000.
Crossrefs
Programs
-
Mathematica
nn = 120; c[] := False; h[] := 0; f[n_] := DivisorSigma[0, n]; a[1] = j = u = 1; Do[If[c[j], k = j + f[u]; h[j]++; h[u]--, k = f[j]; c[j] = True; h[j]++]; u = Min[u, j]; Set[{a[n], j}, {k, k}]; While[h[u] == 0, u++], {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Feb 02 2023 *)
Comments