login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A120797 a(0) = 1. a(n) = n + (largest noncomposite {1 or prime} occurring earlier in the sequence). 0

%I #6 Apr 09 2014 10:15:17

%S 1,2,4,5,9,10,11,18,19,28,29,40,41,54,55,56,57,58,59,78,79,100,101,

%T 124,125,126,127,154,155,156,157,188,189,190,191,226,227,264,265,266,

%U 267,268,269,312,313,358,359,406,407,408,409,460,461,514,515,516,517,518

%N a(0) = 1. a(n) = n + (largest noncomposite {1 or prime} occurring earlier in the sequence).

%e Among terms a(0) through a(9), a(8) = 19 is the largest noncomposite. So a(10) = 10 + 19 = 29.

%o (PARI) {m=58;print1(a=1,",");v=[a];for(n=1,m,v=vecsort(v);j=#v;a=0;while(a<1,k=v[j];if(isprime(k)||k==1,print1(a=n+k,",");v=concat(v,a),j--)))} - (Klaus Brockhaus, Aug 17 2006)

%K nonn

%O 0,2

%A _Leroy Quet_, Jul 05 2006

%E More terms from _Klaus Brockhaus_, Aug 17 2006

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 6 16:31 EDT 2024. Contains 372296 sequences. (Running on oeis4.)