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.

A054408 a(n) = smallest positive integer not already in sequence such that the partial sum a(1)+...+a(n) is prime.

This page as a plain text file.
%I A054408 #24 Jun 06 2021 02:54:02
%S A054408 2,1,4,6,10,8,12,16,14,24,30,22,18,26,34,36,20,28,38,40,32,42,46,48,
%T A054408 44,52,56,60,54,58,66,50,64,62,70,84,90,72,92,76,86,94,74,88,68,82,80,
%U A054408 102,96,100,114,98,78,112,120,110,108,106,126,122,130,132,134,124,128,118
%N A054408 a(n) = smallest positive integer not already in sequence such that the partial sum a(1)+...+a(n) is prime.
%C A054408 1 is the only odd number in this sequence. - _Derek Orr_, Feb 07 2015
%C A054408 Conjecture: Every even numbers appears. - _N. J. A. Sloane_, May 29 2017
%H A054408 Chai Wah Wu, <a href="/A054408/b054408.txt">Table of n, a(n) for n = 1..10000</a> (terms n = 1..4100 from N. J. A. Sloane).
%t A054408 t = {2}; Do[i = 1; While[! PrimeQ[Total[t] + i] || MemberQ[t, i], i++]; AppendTo[t, i], {65}]; t (* _Jayanta Basu_, Jul 04 2013 *)
%o A054408 (PARI) v=[2];n=1;while(n<100,if(isprime(vecsum(v)+n)&&!vecsearch(vecsort(v),n),v=concat(v,n);n=0);n++);v \\ _Derek Orr_, Feb 07 2015
%o A054408 (Python)
%o A054408 from sympy import isprime
%o A054408 def aupton(terms):
%o A054408     alst, aset, asum = [], set(), 0
%o A054408     while len(alst) < terms:
%o A054408         an = 1
%o A054408         while True:
%o A054408             while an in aset: an += 1
%o A054408             if isprime(asum + an):
%o A054408                 alst, aset, asum = alst + [an], aset | {an}, asum + an
%o A054408                 break
%o A054408             an += 1
%o A054408     return alst
%o A054408 print(aupton(66)) # _Michael S. Branicky_, Jun 05 2021
%Y A054408 Cf. A254337.
%Y A054408 See A073659 for another version.
%Y A054408 In A055265 only pairs of adjacent terms add to primes.
%K A054408 nonn,easy
%O A054408 1,1
%A A054408 _Henry Bottomley_, May 09 2000