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.

A335099 Lexicographically earliest sequence of distinct integers greater than 1 such that a(n) mod a(i)^2 >= a(i) for all i < n.

Original entry on oeis.org

2, 3, 6, 7, 14, 15, 22, 23, 26, 30, 31, 34, 35, 42, 43, 58, 59, 62, 66, 67, 70, 71, 78, 79, 86, 87, 94, 95, 106, 107, 114, 115, 122, 123, 130, 131, 134, 138, 139, 142, 143, 158, 159, 166, 167, 170, 174, 175, 178, 179, 186, 187, 194, 195, 210, 211, 214, 215, 222
Offset: 1

Views

Author

James Kilfiger, Sep 12 2020 (suggested by student)

Keywords

Comments

In the sieve of Eratosthenes, first the even numbers are removed, then the multiples of 3, then multiples of 5. In this sieve first the numbers greater than 2 and modulo 0 or 1 (mod 4) are removed leaving (1) 2, 3, 6, 7, 10, 11, 14, 15. Then the numbers greater than 3 and modulo 0, 1, 2 (mod 9) are removed leaving (1) 2, 3, 6, 7, 14, 15. Then numbers modulo 0, 1, 2, 3, 4, 5 (mod 36) are removed.

Crossrefs

Programs

  • Maple
    N:= 1000: # for terms <= N
    R:= NULL:
    Cands:= [$2..N]:
    while Cands <> [] do
      r:= Cands[1];
      R:= R,r;
      Cands:= select(t -> t mod r^2 >= r, Cands[2..-1]);
    od:
    R; # Robert Israel, Sep 05 2024
  • PARI
    seq(n)={my(a=vector(n), k=1); for(n=1, #a, while(1, k++; my(f=1); for(i=1, n-1, if(k%a[i]^2Andrew Howroyd, Sep 12 2020
  • Python3
    from math import sqrt
    length=100
    s=list(range(2,length))
    for p in range(int(sqrt(length))):
        x = s[p]
        if x==0 : continue
        for i,e in enumerate(s):
            if e>x and e%(x*x)
    				

Extensions

Terms a(29) and beyond from Andrew Howroyd, Sep 12 2020