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!)
A350579 The first number in A350578 to appear n times. 2
0, 42, 153, 504, 921, 921, 17729, 17729, 17729, 17729, 60610, 60610, 109617, 109617, 109617, 109617, 109617, 109617, 109599, 658778, 658778, 658778, 658778, 658778, 658778, 658778, 658778, 658778, 658778, 658778, 658778, 658778, 658778, 658778, 658778, 2184074, 2184074, 2184074 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
See A350578 for further details.
LINKS
EXAMPLE
a(1) = 0 as A350578(0) = 0, thus 0 is the first number to appear one time.
a(2) = 42 as A350578(20) = A350578(24) = 42, thus 42 is the first number to appear two times. This is also true for A005132.
a(3) = 153 as A350578(74) = A350578(78) = A350578(114) = 153, thus 153 is the first number to appear three times.
MATHEMATICA
a[0]=0; a[n_]:=a[n]=If[a[n-1]-n>=0&&Count[Array[a, n-1, 0], a[n-1]-n]<=Count[Array[a, n-1, 0], a[n-1]+n], a[n-1]-n, a[n-1]+n];
Table[k=0; While[Max[Last/@(c=Tally@Array[a, ++k, 0])]!=i]; a[k-1], {i, 6}] (* Giorgos Kalogeropoulos, Jan 07 2022 *)
PROG
(Python)
from itertools import count
from collections import Counter
def A350579(n):
b, bcounter = 0, Counter({0})
for m in count(1):
if bcounter[b] == n: return b
b += -m if b-m >= 0 and bcounter[b-m] <= bcounter[b+m] else m
bcounter[b] += 1 # Chai Wah Wu, Jan 08 2022
CROSSREFS
Sequence in context: A158479 A188126 A189500 * A075289 A193571 A326384
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Jan 07 2022
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 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)