The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A356839 a(n) = A005132(2*n) + A005132(2*n+1). 2
1, 9, 9, 33, 33, 33, 33, 33, 33, 105, 105, 59, 59, 59, 59, 59, 125, 191, 191, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 381, 381, 381, 381, 381, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 429, 631, 631, 631, 631, 191, 417, 873, 873 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
MATHEMATICA
r[0] = 0; r[n_] := r[n] = If[(d = r[n - 1] - n) >= 0 && FreeQ[Array[r, n, 0], d], d, r[n - 1] + n]; a[n_] := r[2*n] + r[2*n + 1]; Array[a, 100, 0] (* Amiram Eldar, Sep 02 2022 *)
PROG
(PARI) recaman(N)={ my(s, t, v=vector(N)); for(n=1, N, s=bitor(s, 1<<t += if( t<=n || bittest(s, t-n), n, -n)); v[n]=t); concat(0, v); } \\ adapted from A005132
lista(nn) = my(v=recaman(2*nn+2)); vector(nn, k, v[2*k] + v[2*k-1]); \\ Michel Marcus, Sep 02 2022
(Python)
from itertools import count, islice
def A356839_gen(): # generator of terms
b, aset = 0, set()
for n in count(1):
aset.add(b)
a, b = b, c if (c:=b-n)>=0 and c not in aset else b+n
if n&1:
yield a+b
A356839_list = list(islice(A356839_gen(), 70)) # Chai Wah Wu, Sep 15 2022
CROSSREFS
Cf. A005132.
Sequence in context: A147378 A146604 A294691 * A147172 A146825 A147029
KEYWORD
nonn
AUTHOR
Paul Curtz, Aug 31 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 June 15 16:34 EDT 2024. Contains 373410 sequences. (Running on oeis4.)