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.

This page as a plain text file.
%I A335099 #27 Sep 05 2024 17:16:33
%S A335099 2,3,6,7,14,15,22,23,26,30,31,34,35,42,43,58,59,62,66,67,70,71,78,79,
%T A335099 86,87,94,95,106,107,114,115,122,123,130,131,134,138,139,142,143,158,
%U A335099 159,166,167,170,174,175,178,179,186,187,194,195,210,211,214,215,222
%N A335099 Lexicographically earliest sequence of distinct integers greater than 1 such that a(n) mod a(i)^2 >= a(i) for all i < n.
%C A335099 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.
%H A335099 Robert Israel, <a href="/A335099/b335099.txt">Table of n, a(n) for n = 1..10000</a>
%p A335099 N:= 1000: # for terms <= N
%p A335099 R:= NULL:
%p A335099 Cands:= [$2..N]:
%p A335099 while Cands <> [] do
%p A335099   r:= Cands[1];
%p A335099   R:= R,r;
%p A335099   Cands:= select(t -> t mod r^2 >= r, Cands[2..-1]);
%p A335099 od:
%p A335099 R; # _Robert Israel_, Sep 05 2024
%o A335099 (Python3)
%o A335099 from math import sqrt
%o A335099 length=100
%o A335099 s=list(range(2,length))
%o A335099 for p in range(int(sqrt(length))):
%o A335099     x = s[p]
%o A335099     if x==0 : continue
%o A335099     for i,e in enumerate(s):
%o A335099         if e>x and e%(x*x)<x:
%o A335099             s[i]=0  # mark sieved values as zero
%o A335099 result =[j for j in s if j!=0] # remove zeros
%o A335099 print(result)
%o A335099 (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]^2<a[i], f=0; break)); if(f, a[n]=k; break))); a} \\ _Andrew Howroyd_, Sep 12 2020
%Y A335099 Cf. A000960, A000040.
%K A335099 nonn,easy
%O A335099 1,1
%A A335099 _James Kilfiger_, Sep 12 2020 (suggested by student)
%E A335099 Terms a(29) and beyond from _Andrew Howroyd_, Sep 12 2020