login
A357270
a(n) = s(n) mod prime(n+1), where s = A143293.
1
1, 0, 4, 4, 7, 11, 0, 3, 15, 6, 11, 9, 4, 41, 4, 26, 28, 56, 4, 54, 23, 37, 78, 48, 11, 17, 32, 68, 85, 34, 78, 12, 120, 28, 68, 24, 76, 116, 17, 55, 40, 3, 91, 111, 132, 133, 195, 75, 179, 44, 211, 108, 3, 63, 21, 28, 85, 22, 208, 237, 9, 166, 81, 183, 205, 208
OFFSET
0,3
COMMENTS
Let i be some positive integer. Let r(n) = i mod prime(n+1). Let m be defined such that s(m-1) <= i < s(m). Then the first m values in the sequence {r(n)} uniquely define the integer (it is the least positive integer requiring those m remainders modulo those primes). If i is a term of {s(n)}, then a(n) = r(n) for n = 0..m-1.
LINKS
Christopher A. Curry, Table of n, a(n) for n = 0..9999
MATHEMATICA
q[n_] := Insert[Table[Mod[Total[Table[Product[Prime[i], {i, 1, r}], {r, m}]] + 1, Prime[m + 1]], {m, n}], 1, 1]; q[65] (* Samuel Harkness, Sep 22 2022 *)
PROG
(PARI) a(n) = if(n==0, return(1)); my(P=1, s=1); forprime(p=2, prime(n), s+=P*=p); s % prime(n+1); \\ Michel Marcus, Sep 22 2022
(PARI) a(n, q=prime(n+1))=my(P=Mod(1, q), s=P); forprime(p=2, q-1, s+=P*=p); lift(s) \\ Charles R Greathouse IV, Sep 22 2022
CROSSREFS
Sequence in context: A187893 A293678 A063984 * A347060 A211643 A284640
KEYWORD
nonn,easy
AUTHOR
STATUS
approved