cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A095258 a(n+1) is the smallest divisor of (2 + sum of first n terms) but not occurring earlier; a(1) = 1.

This page as a plain text file.
%I A095258 #33 Jan 26 2022 02:30:50
%S A095258 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,
%T A095258 16,32,48,51,289,578,102,36,26,73,219,30,20,14,46,50,470,60,40,146,21,
%U A095258 49,28,113,29,19,35,42,54,64,22,77,329,84,56,292,365,65,37,131,38,33
%N A095258 a(n+1) is the smallest divisor of (2 + sum of first n terms) but not occurring earlier; a(1) = 1.
%C A095258 Conjecture: integer permutation with inverse A095259: a(A095259(n))=A095259(a(n))=n. - Comment revised: _Reinhard Zumkeller_, Dec 31 2014
%C A095258 A095260(n) = a(a(n)).
%C A095258 First fixed points: 1, 4, 54, 416, ...
%C A095258 A253415(n) = smallest missing number within the first n terms. - _Reinhard Zumkeller_, Dec 31 2014
%H A095258 Rémy Sigrist, <a href="/A095258/b095258.txt">Table of n, a(n) for n = 1..10000</a> (first 797 terms from Reinhard Zumkeller)
%H A095258 Michael De Vlieger, <a href="/A095258/a095258.png">Log-log scatterplot of a(n)</a> for n = 1..2^16.
%H A095258 Michael De Vlieger, <a href="/A095258/a095258_1.png">Annotated log-log scatterplot of a(n)</a> for n = 1..2^14 showing records in red, local minima in blue, primes in magenta, prime powers not prime in gold.
%H A095258 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%t A095258 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 *)
%o A095258 (Haskell)
%o A095258 import Data.List (delete)
%o A095258 a095258 n = a095258_list !! (n-1)
%o A095258 a095258_list = 1 : f [2..] 1 where
%o A095258    f xs z = g xs where
%o A095258      g (y:ys) = if mod z' y > 0 then g ys else y : f (delete y xs) (z + y)
%o A095258      z' = z + 2
%o A095258 -- _Reinhard Zumkeller_, Dec 31 2014
%o A095258 (Python)
%o A095258 from itertools import islice
%o A095258 from sympy import divisors
%o A095258 def A095258_gen(): # generator of terms
%o A095258     bset, s = {1}, 3
%o A095258     yield 1
%o A095258     while True:
%o A095258         for d in divisors(s):
%o A095258             if d not in bset:
%o A095258                 yield d
%o A095258                 bset.add(d)
%o A095258                 s += d
%o A095258                 break
%o A095258 A095258_list = list(islice(A095258_gen(),30)) # _Chai Wah Wu_, Jan 25 2022
%Y A095258 Cf. A253415.
%K A095258 nonn,look
%O A095258 1,2
%A A095258 _Reinhard Zumkeller_, May 31 2004