A367067 a(1)=3, thereafter a(n) is the least positive integer not yet in the sequence such that Sum_{i=1..n} a(i) == 3 (mod n+3).
3, 5, 1, 8, 2, 11, 13, 4, 16, 18, 6, 21, 7, 24, 26, 9, 29, 10, 32, 34, 12, 37, 39, 14, 42, 15, 45, 47, 17, 50, 52, 19, 55, 20, 58, 60, 22, 63, 23, 66, 68, 25, 71, 73, 27, 76, 28, 79, 81, 30, 84, 31, 87, 89, 33, 92, 94, 35, 97, 36, 100, 102, 38, 105
Offset: 1
Keywords
Links
- Muharem Avdispahić and Faruk Zejnulahi, An integer sequence with a divisibility property, Fibonacci Quarterly, Vol. 58:4 (2020), 321-333.
- Jeffrey Shallit, Proving properties of some greedily-defined integer recurrences via automata theory, arXiv:2308.06544 [cs.DM], 2023.
Programs
-
Mathematica
lst = {3}; f[s_List] := Block[{k = 1, len = 4 + Length@lst, t = Plus @@ lst}, While[MemberQ[s, k] || Mod[k + t, len] != 3, k++]; AppendTo[lst, k]]; Nest[f, lst, 100]
-
Python
z_list=[-1,3,5] m_list=[-1,0,1] n=2 for n in range(2, 100): if m_list[n] in z_list: m_list.append(m_list[n] + 1) z_list.append(m_list[n+1] + n+3) else: m_list.append(m_list[n]) z_list.append(m_list[n+1]) print(z_list[1:])
Comments