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.
%I A045954 #35 Nov 17 2022 05:15:37 %S A045954 2,4,6,10,12,18,20,22,26,34,36,42,44,50,52,54,58,68,70,76,84,90,98, %T A045954 100,102,108,114,116,118,130,132,138,140,148,150,164,170,172,178,182, %U A045954 186,196,198,212,214,218,228,230,234,244,246,260,262,268,278,282,290,298,300,308 %N A045954 Even-Lucky-Numbers: generated by a sieve process like that for Lucky numbers but starting with even numbers. %C A045954 Write down even numbers: 2, 4, 6, 8, ...; first term > 2 is 4 so starting from 2 remove every 4th number: 2, 4, 6, 10, 12, 14, 18, ...; next number is 6 so remove every 6th term starting from 2: 2, 4, 6, 10, 12, 18, 20, 22, 26, etc. %H A045954 Reinhard Zumkeller, <a href="/A045954/b045954.txt">Table of n, a(n) for n = 1..1000</a> %H A045954 <a href="/index/Si#sieve">Index entries for sequences generated by sieves</a> %p A045954 ## Finds all Even Lucky Numbers up to n from the list 2..n. %p A045954 ## Try n=10^5 or 10^6 just for fun! %p A045954 evenluckynumbers:=proc(n) local k, Lnext, Lprev; Lprev:=[$2..n]; for k from 1 do Lnext:= map(w-> Lprev[w],remove(z -> z mod Lprev[k] = 0,[$1..nops(Lprev)])); if nops(Lnext)=nops(Lprev) then return Lnext fi; Lprev:=Lnext; od; end: # _Walter Kehowski_, Jun 06 2008 %t A045954 lst = Range[2, 308, 2]; i = 2; While[ i <= (len = Length@lst) && (k = lst[[i]]) <= len, lst = Drop[lst, {k, len, k}]; i++ ]; lst (* _Robert G. Wilson v_, May 11 2006 *) %o A045954 (Haskell) %o A045954 a045954 n = a045954_list !! (n-1) %o A045954 a045954_list = 2 : sieve 2 [2,4..] where %o A045954 sieve k xs = z : sieve (k + 1) (lucky xs) where %o A045954 z = xs !! (k - 1 ) %o A045954 lucky ws = us ++ lucky vs where %o A045954 (us, _:vs) = splitAt (z - 1) ws %o A045954 -- _Reinhard Zumkeller_, Dec 05 2011 %Y A045954 Cf. A000959, A039672. %K A045954 nice,nonn,easy %O A045954 1,1 %A A045954 _Felice Russo_