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(n) is the least composite number that has not yet appeared such that the n-th partial sum is a multiple of the n-th prime.
1

%I #17 Dec 08 2024 04:00:50

%S 4,8,18,12,24,25,28,14,51,48,16,85,36,104,44,66,125,146,84,56,174,96,

%T 64,185,39,165,34,68,143,72,252,203,114,38,190,189,120,446,88,132,490,

%U 410,69,50,100,249,312,535,108,54,341,168,297,290,688,186,455,335,198,413

%N a(n) is the least composite number that has not yet appeared such that the n-th partial sum is a multiple of the n-th prime.

%H Robert Israel, <a href="/A075558/b075558.txt">Table of n, a(n) for n = 1..10000</a>

%p s:= 0: Cands:= remove(isprime, [$4..1000]): nC:= nops(Cands):

%p R:= NULL: s:= 0: p:= 1:

%p for n from 1 do

%p p:= nextprime(p);

%p found:= false;

%p for i from 1 to nC do

%p if s + Cands[i] mod p = 0 then

%p R:= R, Cands[i];

%p s:= s + Cands[i];

%p Cands:= subsop(i=NULL,Cands);

%p nC:= nC-1;

%p found:= true;

%p break

%p fi

%p od;

%p if not found then break fi

%p od:

%p R;

%Y Cf. A002808 (composite numbers).

%K nonn,look

%O 1,1

%A _Amarnath Murthy_, Sep 24 2002

%E More terms from _Ray Chandler_, Oct 25 2003

%E Name changed by _Robert Israel_, Dec 07 2024