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!)
A300392 a(1)=1, a(n) = max(sum0,sum1) mod n, where sum0 is the sum of previous terms with even indices, sum1 with odd indices. 2

%I #36 May 09 2021 07:56:26

%S 1,1,1,2,3,5,1,0,8,4,3,5,4,7,9,14,4,2,2,0,19,11,9,16,17,3,0,25,8,5,7,

%T 4,5,2,1,34,29,26,10,6,8,4,4,0,41,10,6,8,4,4,0,48,34,30,1,52,43,38,12,

%U 6,6,0,57,52,34,28,50,44,13,6,5,70,61,54,26,18,28

%N a(1)=1, a(n) = max(sum0,sum1) mod n, where sum0 is the sum of previous terms with even indices, sum1 with odd indices.

%C Conjecture: every integer appears infinitely many times.

%C From _Rémy Sigrist_, Mar 30 2018: (Start)

%C The sequence is 2-periodic in the interval n = 669..717: in this interval, a(2*k) = 176 and a(2*k+1) = 264.

%C The sequence is 2-periodic in the interval n = 585469..588887: in this interval, a(2*k) = 146528 and a(2*k+1) = 219792.

%C The sequence is 2-periodic in the interval n = 481689629..481728001: in this interval, a(2*k) = 120425588 and a(2*k+1) = 180638382.

%C (End)

%C The sequence of indices of zeros begins: 8, 20, 27, 44, 51, 62, 319, 836, 1280, 2216, 2320, 4318, 24075, 94832, 125815, 155635, 459384, 471600, 683516, 6870325... - _Alex Ratushnyak_, Feb 21 2020

%H Alois P. Heinz, <a href="/A300392/b300392.txt">Table of n, a(n) for n = 1..20000</a> (first 2000 terms from Rémy Sigrist)

%H Rémy Sigrist, <a href="/A300392/a300392.png">Colored scatterplot of the sequence for n = 1..1000000</a>

%H Rémy Sigrist, <a href="/A300392/a300392_1.png">Scatterplot of the sequence for n = 550000..600000</a>

%e a(8) = max(5+2+1,1+3+1+1) mod 8 = 0.

%p s:= proc(n) s(n):= `if`(n<1, 0, a(n)+s(n-2)) end:

%p a:= proc(n) a(n):= `if`(n<2, n, irem(max(s(n-1), s(n-2)), n)) end:

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Mar 31 2018

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

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

%t Array[a, 100] (* _Jean-François Alcover_, May 31 2019, from Maple *)

%o (Python)

%o a = [1]

%o s0 = 0

%o s1 = 1

%o for n in range(2,1000):

%o v = max(s1, s0) % n

%o a.append(v)

%o if n&1: s1 += v

%o else: s0 += v

%o print(a)

%o (PARI) lista(nn) = {my(va = [], na = 1, s0 = 0, s1 = 0); print1(na, ", "); va = concat(va, na); for (n=2, nn, if (n % 2, s1 += na, s0 += na); na = max(s0, s1) % n; print1(na, ", "); va = concat(va, na););} \\ _Michel Marcus_, Mar 05 2018

%Y Cf. A332581.

%K nonn

%O 1,4

%A _Alex Ratushnyak_, Mar 05 2018

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