A366475 a(n) = (A364054(n) - A366470(n))/prime(n-1).
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
Offset: 2
Keywords
Examples
n p(n-1) x y a(n) [x = A364054(n), y = A366470(n)] 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 ...
Links
- Michael De Vlieger, Table of n, a(n) for n = 2..65536
- 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.
Programs
-
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]; Array[b, nn-1, 2] (* Michael De Vlieger, Oct 26 2023 *)
-
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 A366475_list = list(islice(A366475_gen(),30)) # Chai Wah Wu, Oct 27 2023
Comments