login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A366475 a(n) = (A364054(n) - A366470(n))/prime(n-1). 4
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?
Answer: a(28025) = 4. - Michael De Vlieger, Oct 26 2023
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
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
...
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 *)
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
A366475_list = list(islice(A366475_gen(), 30)) # Chai Wah Wu, Oct 27 2023
CROSSREFS
Cf. A364054, A366470, A366477 (records).
Sequence in context: A332902 A204423 A112170 * A259976 A113685 A049825
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Oct 26 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 16 12:01 EDT 2024. Contains 374348 sequences. (Running on oeis4.)