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 A066246 #25 Jul 29 2025 08:38:56 %S A066246 0,0,0,1,0,2,0,3,4,5,0,6,0,7,8,9,0,10,0,11,12,13,0,14,15,16,17,18,0, %T A066246 19,0,20,21,22,23,24,0,25,26,27,0,28,0,29,30,31,0,32,33,34,35,36,0,37, %U A066246 38,39,40,41,0,42,0,43,44,45,46,47,0,48,49,50,0,51,0,52,53,54,55,56,0,57 %N A066246 a(n) = 0 unless n is a composite number A002808(k) then a(n) = k. %H A066246 Charles R Greathouse IV, <a href="/A066246/b066246.txt">Table of n, a(n) for n = 1..10000</a> %F A066246 a(n) = A239968(n) + A010051(n) - 1. - _Reinhard Zumkeller_, Mar 30 2014 %F A066246 a(n) = A065855(n)*A005171(n). - _Ridouane Oudra_, Jul 29 2025 %t A066246 Module[{k=1},Table[If[CompositeQ[n],k;k++,0],{n,100}]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Jan 03 2019 *) %o A066246 (PARI) a(n)=if(isprime(n),0,max(0,n-primepi(n)-1)) \\ _Charles R Greathouse IV_, Aug 21 2011 %o A066246 (Haskell) %o A066246 import Data.List (unfoldr, genericIndex) %o A066246 a066246 n = genericIndex a066246_list (n - 1) %o A066246 a066246_list = unfoldr x (1, 1, a002808_list) where %o A066246 x (i, z, cs'@(c:cs)) | i == c = Just (z, (i + 1, z + 1, cs)) %o A066246 | i /= c = Just (0, (i + 1, z, cs')) %o A066246 -- _Reinhard Zumkeller_, Jan 29 2014 %Y A066246 Cf. A002808, A239968, A010051, A049084. %Y A066246 Cf. A026233, A026238, A065855, A005171. %K A066246 nonn %O A066246 1,6 %A A066246 _Reinhard Zumkeller_, Dec 09 2001