login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
For n >= 1, a(n) <= A343880(n) + 1. - Peter Munn, May 08 2021
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)
def A343878(n):
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
m += 1 # Chai Wah Wu, Aug 31 2021
CROSSREFS
For records see A347305.
Sequence in context: A050904 A263637 A347305 * A057471 A295608 A349048
KEYWORD
nonn,look,easy
AUTHOR
Rémy Sigrist, May 02 2021
EXTENSIONS
Name shortened by Peter Munn, May 08 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 10:28 EDT 2024. Contains 371779 sequences. (Running on oeis4.)