|
|
A343878
|
|
a(n) is the least k such that A342585(k) = n.
|
|
4
|
|
|
1, 2, 5, 9, 11, 21, 25, 30, 47, 39, 59, 71, 96, 100, 126, 115, 160, 178, 197, 217, 221, 261, 243, 265, 336, 322, 374, 419, 397, 479, 425, 485, 551, 583, 649, 618, 723, 653, 801, 690, 727, 887, 930, 974, 889, 932, 1115, 976, 1260, 1310, 1023, 1414, 1070, 1522
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
The term after the n-th 0 in A342585 is the running total of 0's, and there are infinitely many 0's, so all nonnegative integers appear in A342585. - Peter Munn, May 08 2021
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
We have:
n: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21
A342585: 0, 1, 1, 0, 2, 2, 2, 0, 3, 2, 4, 1, 1, 0, 4, 4, 4, 1, 4, 0, 5
So:
- a(0) = 1, a(1) = 2, a(2) = 5, a(3) = 9, a(4) = 11, a(5) = 21.
|
|
MATHEMATICA
|
Block[{a, c, k, m, nn = 54}, c[0] = 1; a = {0}~Join~Reap[Do[k = 0; While[IntegerQ[c[k]], Set[m, c[k]]; Sow[m]; If[IntegerQ@ c[m], c[m]++, c[m] = 1]; k++]; Sow[0]; c[0]++, nn]][[-1, -1]]; TakeWhile[Array[FirstPosition[a, #][[1]] &, nn, 0], IntegerQ]] (* Michael De Vlieger, Oct 12 2021 *)
|
|
PROG
|
(PARI) See Links section.
(Python)
k, c = 0, dict()
while True:
m, r = 0, 1
while r > 0:
k += 1
r = c.get(m, 0)
if n == r:
return k
c[r] = c.get(r, 0)+1
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|