OFFSET
1,3
COMMENTS
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^20.
EXAMPLE
a(1) = 1 (a given novel term) means a(2) = 1 since there is just one term having digit sum not exceeding 1.
Since 1 has now occurred twice, a(3) = 2*1 = 2, another novel term with digit sum = 2.
a(4) = 3 since there are now 3 terms up to and including a(3) = 3 with digit sum <= 3.
This pattern continues(4, 5, 6, ...) until reaching a(11) = 10, a novel term with digit sum = 1. At this point the number of terms in {a(1), a(2), ..., a(11)} having digit sum equal to at most 1 is 3, so a(12) = 3.
Then since 3 has been seen twice, a(13) = 6; and so on.
MATHEMATICA
nn = 120; c[_] := 0; s[_] := 0; a[1] = j = 1;
Do[m = DigitSum[j]; s[m]++;
If[c[j] == 0,
k = Total@ Table[s[i], {i, m}],
k = (1 + c[j])*j ];
c[j]++;
Set[{a[n], j}, {k, k}], {n, 2, nn}];
Array[a, nn] (* Michael De Vlieger, Dec 10 2024 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
David James Sycamore, Nov 22 2024
EXTENSIONS
Corrected and extended by Michael De Vlieger, Dec 10 2024.
STATUS
approved