cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

Original entry on oeis.org

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

Views

Author

Zenan Sabanac, Nov 03 2023

Keywords

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).

Crossrefs

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:])