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!)
A375118 Let {b(m)} be Recamán's sequence A005132, with the additional term b(-1):=0. Define a(n) to be the first index m where b(m-1)-m = -n, or -1 if b(m-1)-m never equals -n. 0
0, 1, 181695, 5, 1523, 137, 15, 1525, 139, 17, 1527, 141, 28, 1529, 143, 30, 1531, 145, 32, 1533, 147, 53, 1535, 149, 55, 1537, 151, 57, 1539, 153, 59, 1541, 155, 61, 1543, 157, 63, 1545, 159, 65, 1547, 161, 276, 1549, 163, 278, 1551, 165, 280, 1553, 167, 282 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
This sequence is interesting because of the spike at the 2nd term.
The next similar spike occurs at a(59)=181733.
LINKS
EXAMPLE
Recamán's sequence {b(m)} begins with 0, 1, 3, 6, 2, 7, 13,...
b(1-1)-1 = 0-1 = -1, so a(1) = 1.
b(5-1)-5 = 2-5 = -3, so a(3) = 5.
PROG
(Python)
def a(n):
a = [0]
for i in range(1, n):
a+=[-1]
countA = 1
seq = [0]
m = 1
while(countA < n):
x = seq[m-1]-m
if(x<0):
if(-x < n and a[-x]==-1):
a[-x] = m
countA+=1
seq+=[seq[m-1]+m]
else:
if(x not in seq):
seq+=[x]
else:
seq+=[seq[m-1]+m]
m+=1
return a #find all terms in range(0, n)
CROSSREFS
Sequence in context: A209828 A133541 A145536 * A249959 A250013 A258842
KEYWORD
nonn
AUTHOR
Jens Askgaard, Jul 30 2024
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 September 9 06:26 EDT 2024. Contains 375759 sequences. (Running on oeis4.)