|
|
A095258
|
|
a(n+1) is the smallest divisor of (2 + sum of first n terms) but not occurring earlier; a(1) = 1.
|
|
13
|
|
|
1, 3, 2, 4, 6, 9, 27, 18, 8, 5, 17, 34, 68, 12, 24, 10, 25, 11, 13, 23, 7, 47, 94, 235, 15, 16, 32, 48, 51, 289, 578, 102, 36, 26, 73, 219, 30, 20, 14, 46, 50, 470, 60, 40, 146, 21, 49, 28, 113, 29, 19, 35, 42, 54, 64, 22, 77, 329, 84, 56, 292, 365, 65, 37, 131, 38, 33
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
First fixed points: 1, 4, 54, 416, ...
|
|
LINKS
|
|
|
MATHEMATICA
|
c[_] = 0; j = c[1] = 1; s = 3; {j}~Join~Reap[Do[d = Divisors[s]; k = 1; While[c[d[[k]]] > 0, k++]; Set[k, d[[k]]]; Set[c[k], i]; Sow[k]; j = k; s += k, {i, 2, 80}]][[-1, -1]] (* Michael De Vlieger, Jan 23 2022 *)
|
|
PROG
|
(Haskell)
import Data.List (delete)
a095258 n = a095258_list !! (n-1)
a095258_list = 1 : f [2..] 1 where
f xs z = g xs where
g (y:ys) = if mod z' y > 0 then g ys else y : f (delete y xs) (z + y)
z' = z + 2
(Python)
from itertools import islice
from sympy import divisors
def A095258_gen(): # generator of terms
bset, s = {1}, 3
yield 1
while True:
for d in divisors(s):
if d not in bset:
yield d
bset.add(d)
s += d
break
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|