OFFSET
1,2
LINKS
Winston de Greef, Table of n, a(n) for n = 1..5000
MATHEMATICA
PROG
(Python)
from itertools import islice
def A360393_gen(): # generator of terms
yield from (1, 2)
blist, s = [1], 3
while True:
c = [3-d for d in blist]
blist += c
for d in c:
yield from range(s+1, s:=s+d)
(PARI) a(n) = if(n < 3, [1, 2][n], 3*n - 5 - hammingweight(n-3)%2) \\ Winston de Greef, Mar 27 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Feb 05 2023
STATUS
approved