cp's OEIS Frontend

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.

A174956 0 unless n is the k-th semiprime when a(n) = k.

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 0, 0, 3, 4, 0, 0, 0, 5, 6, 0, 0, 0, 0, 0, 7, 8, 0, 0, 9, 10, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 14, 15, 0, 0, 0, 0, 0, 0, 16, 0, 0, 17, 0, 18, 0, 0, 0, 19, 0, 20, 21, 0, 0, 0, 22, 0, 0, 23, 0, 0, 0, 24, 0, 0, 0, 0, 25, 0, 0, 26, 0, 0, 0, 0, 27, 0, 0, 28, 29, 30, 0, 0, 0, 31, 0, 32, 33
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 03 2010

Keywords

Comments

a(A001358(n)) = n; a(A100959(n)) = 0.

Crossrefs

Cf. A049084.

Programs

  • Haskell
    import Data.List (unfoldr)
    a174956 n = a174956_list !! (fromInteger n - 1)
    a174956_list = unfoldr x (1, 1, a001358_list) where
       x (i, z, ps'@(p:ps)) | i == p = Just (z, (i + 1, z + 1, ps))
                            | i /= p = Just (0, (i + 1, z, ps'))
    -- Reinhard Zumkeller, Oct 27 2012
    
  • Mathematica
    nn = 100; With[{tbl = Table[If[PrimeOmega[n] == 2, 1, 0], {n, nn}]},
    Table[If[tbl[[i]] == 0, 0, Total[Take[tbl, i]]], {i, nn}]] (* Harvey P. Dale, Oct 13 2012 *)
  • PARI
    first(n)=my(v=List(),u=vector(n)); forprime(p=2,n\2, forprime(q=2,min(p,n\p), listput(v,p*q))); v=Set(v); for(i=1,#v, u[v[i]]=i); u \\ Charles R Greathouse IV, Sep 02 2015

Formula

a(n) = A064911(n)*A072000(n).