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!)
A145198 a(n) is the least number not already in the sequence and not the product of consecutive terms in the sequence. 2

%I #13 Jun 11 2020 16:50:09

%S 1,2,3,4,5,7,8,9,10,11,13,14,15,16,17,18,19,21,22,23,25,26,27,28,29,

%T 30,31,32,33,34,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,

%U 54,55,57,58,59,61,62,63,64,65,66,67,68,69,70,71,73,74,75,76,77,78,79,80

%N a(n) is the least number not already in the sequence and not the product of consecutive terms in the sequence.

%H Rémy Sigrist, <a href="/A145198/b145198.txt">Table of n, a(n) for n = 1..10000</a>

%o (PARI) {m=72; v=vector(m); z=2*m; u=vectorsmall(z); k=1; for(n=1, m, while(u[k], k++); v[n]=k; u[k]=1; j=n-1; p=k; while(j>0&&(p=p*v[j])<=z, u[p]=1; j--)); for(i=1, m, print1(v[i], ","))} \\ _Klaus Brockhaus_, Oct 06 2008

%o HP 49G calculator program from _Gerald Hillier_, Oct 24 2008

%o << 0 OVER NDUPN

%o ->LIST DUPDUP + 1 0

%o 0 -> M V U K J P

%o << 1 M

%o FOR N K

%o WHILE U OVER

%o GET

%o REPEAT 1 +

%o END 'K' STO V

%o N K PUT 'V' STO U K

%o 1 PUT N 1 - 'J' STO

%o K 'P' STO

%o WHILE J 0 >

%o IF

%o THEN P V J

%o GET * DUP 'P' STO M

%o 2 * <=

%o ELSE 0

%o END

%o REPEAT P 1

%o PUT J 1 - 'J' STO

%o END 'U' STO

%o NEXT V

%o >>

%o >>

%Y Cf. A002048, A145278 (complement).

%K nonn

%O 1,2

%A _Gerald Hillier_, Oct 04 2008

%E Extended by _Klaus Brockhaus_, Oct 06 2008

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 April 25 16:39 EDT 2024. Contains 371989 sequences. (Running on oeis4.)