OFFSET
1,1
COMMENTS
Every term greater than 4 has the form 4*t + 3.
Let b(z) be the number of elements of this sequence <= z:
-------------
z | b(z)
-------------
10^2 | 8
10^3 | 14
10^4 | 32
10^5 | 55
10^6 | 125
10^7 | 347
10^8 | 950
-------------
Every term greater than 4 is prime.
LINKS
Jinyuan Wang, Table of n, a(n) for n = 1..3000
EXAMPLE
Let T(i,j) be the triangle read by rows: T(i,j) = (i - floor((i - j)/j)) mod j for 1 <= j <= i. The triangle begins:
i\j | 1 2 3 4 5 6 7 8 9 ...
-----+------------------
1 | 0
2 | 0 0
3 | 0 1 0
4 | 0 1 1 0
5 | 0 0 2 1 0
6 | 0 0 2 2 1 0
7 | 0 1 0 3 2 1 0
8 | 0 1 1 3 3 2 1 0
9 | 0 0 1 0 4 3 2 1 0
...
The j-th column has period j^2, r-th element of this period has the form (r - 1 - floor((r - 1)/j)) mod j (1 <= r <= j^2). The period of j-th column consists of the sequence (0,1,2,...,j-1) and its consecutive j-1 right rotations (moving rightmost element to the left end).
7 is in this sequence because the only k's satisfying the equation (7 - floor((7 - k)/k)) mod k = 1 are 2 and (7-1).
PROG
(Maxima)
(f(i, j):=mod((i-floor((i-j)/j)), j),
(n:3, for t:7 thru 100000 step 4 do
(for k:3 while f(t, k)#1 and k<ceiling(t/2) do
(if k=ceiling(t/2)-1 then (print(n, "", t), n:n+1)))));
(PARI) is(m) = if(m%4==3, for(k=3, m\2, if((m-m\k)%k==0, return(0))); 1, m==4); \\ Jinyuan Wang, Jan 14 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Lechoslaw Ratajczak, Nov 21 2024
STATUS
approved