login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(1) = 1; a(n) is the smallest positive integer not already in the sequence such that Sum_{k=1..n} k*a(k) is a prime.
1

%I #15 Dec 11 2019 21:33:43

%S 1,2,4,3,6,5,12,7,16,9,14,13,8,11,10,17,18,15,22,24,20,23,26,25,30,28,

%T 32,33,38,29,48,27,34,44,36,19,42,47,52,35,50,21,56,53,46,39,60,45,54,

%U 31,40,37,58,49,70,55,68,61,72,43,98,41,74,57,84,59,78,64,82

%N a(1) = 1; a(n) is the smallest positive integer not already in the sequence such that Sum_{k=1..n} k*a(k) is a prime.

%C Proposed by _Leroy Quet_, Feb 13 2004; computed by several people including Fred W. Helenius, Feb 14 2004.

%C Comment from Fred Helenius: Every positive integer up to 82 appears in the first 100 terms; everything up to 922 appears in the first 1000. Apart from a(1), odd-indexed terms must be even; even-indexed terms are occasionally even as well, so the odd values tend to arrive late.

%o (PARI) v=[1];n=1;while(n<100,s=n*(#v+1)+sum(i=1,#v,i*v[i]);if(isprime(s)&&!vecsearch(vecsort(v),n),v=concat(v,n);n=0);n++);v \\ _Derek Orr_, Jun 03 2015

%Y Cf. A091851.

%K nonn,easy

%O 1,2

%A _N. J. A. Sloane_, Mar 13 2004