login
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).
1
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,1
COMMENTS
This is the Avdispahić-Zejnulahi sequence AZ(3).
Note that AZ(3) is the third term in a sequence of permutations of the set of positive integers defined by a specific divisibility property (see Links section and Crossrefs for details).
LINKS
Muharem Avdispahić and Faruk Zejnulahi, An integer sequence with a divisibility property, Fibonacci Quarterly, Vol. 58:4 (2020), 321-333.
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]
PROG
(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:])
CROSSREFS
Sequence in context: A065395 A236631 A302800 * A340529 A197326 A235605
KEYWORD
nonn
AUTHOR
Zenan Sabanac, Nov 03 2023
STATUS
approved