login
A378293
a(1) = 1. For n > 1 if a(n-1) is a novel term a(n) = number of a(i); 1 <= i <= n-1 whose sum of decimal digits does not exceed A007953(a(n-1)). If a(n-1) has occurred k (>1) times, a(n) = k*a(n-1).
3
1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 6, 12, 7, 14, 10, 20, 6, 18, 20, 40, 12, 24, 19, 25, 22, 14, 28, 29, 30, 12, 36, 30, 60, 25, 50, 21, 15, 28, 56, 41, 23, 24, 48, 45, 40, 80, 38, 48, 96, 51, 33, 34, 39, 54, 46, 50, 100, 5, 10, 30, 90, 52, 45, 90, 180, 56, 112
OFFSET
1,3
COMMENTS
The first condition of the definition implies that if a(n-1) is a novel term then a(n) <= n-1, with equality iff A007953(a(n-1)) >= A007953(a(i)); i = 1..n-1. Only the second condition of the definition can produce a(n) > n, consequent to repeats of a(n-1).
LINKS
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
Sequence in context: A325721 A079050 A378782 * A320109 A278062 A254597
KEYWORD
nonn,base,easy
AUTHOR
EXTENSIONS
Corrected and extended by Michael De Vlieger, Dec 10 2024.
STATUS
approved