|
|
|
|
1, 2, 2, 0, 1, 0, 1, 2, 2, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 3, 0, 2, 0, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 0, 1, 2, 2, 1, 2, 1, 2, 0, 1, 2, 0, 2, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,2
|
|
COMMENTS
|
a(29) = 3. When, if ever, does 4 appear?
|
|
LINKS
|
Michael De Vlieger, 2048 X 2048 raster showing a(n), n = 1..4194304 in rows of 2048 terms, left to right, then continued below for 2048 rows total. Color indicates terms as follows: black = 0, blue = 1, green = 2, gold = 3, red = 4.
|
|
EXAMPLE
|
1 (1) 1 - - [a(n) = (x-y)/p(n-1)]
2 2 3 1 1
3 3 6 0 2
4 5 11 1 2
5 7 4 4 0
6 11 15 4 1
7 13 2 2 0
...
|
|
MATHEMATICA
|
nn = 2^20;
c[_] := False; m[_] := 0; a[1] = j = 1; c[0] = c[1] = True;
Monitor[Do[p = Prime[n - 1]; r = Mod[j, p];
While[Set[k, p m[p] + r ]; c[k], m[p]++];
Set[{a[n], b[n], c[k], j}, {k, m[p], True, k}], {n, 2, nn}], n];
|
|
PROG
|
(Python)
from itertools import count, islice
from sympy import nextprime
def A366475_gen(): # generator of terms
a, aset, p = 1, {0, 1}, 1
while True:
p = nextprime(p)
b = a%p
for i in count(0):
if b not in aset:
aset.add(b)
a = b
break
b += p
yield i
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|