|
|
A366911
|
|
a(n) = (A364054(n+1) - A364054(n)) / prime(n) (where prime(n) denotes the n-th prime number).
|
|
2
|
|
|
1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 1, 1, -3, 2, -2, 1, -1, 1, -1, 2, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,29
|
|
COMMENTS
|
a(n) is the number of steps of size prime(n) in going from A364054(n) to A364054(n+1).
|
|
LINKS
|
|
|
EXAMPLE
|
|
|
MATHEMATICA
|
nn = 2^16; c[_] := False; m[_] := 0; 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 - 1], c[k], j}, {(k - j)/p, True, k}], {n, 2, nn + 1}], n];
|
|
PROG
|
(PARI) See Links section.
(Python)
from itertools import count, islice
from sympy import nextprime
def A366911_gen(): # generator of terms
a, aset, p = 1, {0, 1}, 2
while True:
k, b = divmod(a, p)
for i in count(-k):
if b not in aset:
aset.add(b)
a, p = b, nextprime(p)
yield i
break
b += p
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|