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!)
A110898 a(n) = 1 + a(n - a(n-1)) (n - a(n-1)) mod 3 + (n - a(n-2)) mod 4, with a(0) = 0, a(1) = 1. 3

%I #15 Mar 31 2024 08:48:03

%S 0,1,3,3,2,6,1,3,8,3,5,2,8,8,4,4,9,8,6,11,6,7,5,7,10,7,11,9,12,7,8,6,

%T 10,9,7,14,6,9,6,12,14,11,6,9,15,9,12,15,10,15,13,5,17,7,15,14,8,18,

%U 16,10,12,18,16,15,15,14,20,15,6,18,17,17,17,7,16,9,15,15,19,13,16,13,21,17

%N a(n) = 1 + a(n - a(n-1)) (n - a(n-1)) mod 3 + (n - a(n-2)) mod 4, with a(0) = 0, a(1) = 1.

%H G. C. Greubel, <a href="/A110898/b110898.txt">Table of n, a(n) for n = 0..10000</a>

%t a[n_]:= a[n]= If[n<2, n, 1 +a[n-a[n-1]] +Mod[n-a[n-1],3] -Mod[n-a[n-2],3]];

%t Table[a[n], {n,0,100}]

%o (Magma) [n le 2 select n-1 else 1 + Self(n-Self(n-1)) - ((n+2-Self(n-1)) mod 3) + ((n+3-Self(n-2)) mod 4) : n in [1..101]]; // _G. C. Greubel_, Mar 30 2024

%o (SageMath)

%o @CachedFunction

%o def a(n): # a = A110898

%o if n<2: return n

%o else: return 1 +a(n-a(n-1)) -(n-a(n-1))%3 +(n-a(n-2))%4

%o [a(n) for n in range(101)] # _G. C. Greubel_, Mar 30 2024

%Y Cf. A110897.

%K nonn,easy,less

%O 0,3

%A _Roger L. Bagula_, Sep 20 2005

%E Edited by _G. C. Greubel_, Mar 30 2024

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 19 09:23 EDT 2024. Contains 371782 sequences. (Running on oeis4.)