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!)
A359007 a(n) = b(n-b(n)) where b is Van Eck's sequence A181391. 0

%I #25 Jan 08 2023 22:47:06

%S 0,0,0,0,1,0,2,0,2,0,0,2,0,5,1,0,0,0,2,4,0,5,0,6,0,3,0,0,2,5,0,4,14,6,

%T 3,0,6,15,5,3,9,0,5,3,0,6,5,0,3,8,3,6,0,3,2,0,0,5,9,0,4,1,0,0,3,32,0,

%U 4,11,0,7,17,0,3,11,0,2,31,6,31,0,0,6,3,0,9,2,33,3,0,3,15,0,5

%N a(n) = b(n-b(n)) where b is Van Eck's sequence A181391.

%C In Van Eck's sequence, b(n) is the distance between b(n-1) and the previous occurrence of b(n-1) there. Taking a(n) = b(n-b(n)) is therefore the distance between the second and third last occurrence of b(n-1) there.

%C If b(n-1) has not yet occurred three times then the result is a(n) = 0 either by b(n)=0 when b(n-1) has only occurred once, or b(n-b(n)) = 0 when b(n-1) has only occurred twice.

%e b(14) is 2, so we count back two steps to b(12), which is 5. Therefore a(14) = 5. As b(14-1) = b(13) = 0, the three occurrences of 0's are separated by b(14) and b(12) = a(14), that is, 2 and 5 steps:

%e .

%e n: ... 5 6 7 8 9 10 11 12 13 14 15 16 ...

%e .

%e |<--------5-------->|<--2-->|

%e | | |

%e | | |

%e b(n): ... 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, ...

%e | |

%e v |

%e a(14) = 5 <-----

%e two steps

%e back

%o (PARI) A181391_vec(N, a=0, i=Map())={vector(N, n, a=if(n>1, iferr(n-mapget(i, a), E, 0)+mapput(i, a, n)))};

%o lista(nn) = my(v = A181391_vec(nn)); vector(#v, k, v[k-v[k]]); \\ _Michel Marcus_, Dec 11 2022

%Y Cf. A181391.

%K nonn,easy

%O 1,7

%A _Tamas Sandor Nagy_, Dec 10 2022

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 8 18:41 EDT 2024. Contains 375753 sequences. (Running on oeis4.)