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.

A260798 Number of partitions of p=prime(n) into aliquant parts (i.e., parts that do not divide p, meaning any part except 1 and p).

Original entry on oeis.org

0, 0, 1, 3, 13, 23, 65, 104, 252, 846, 1237, 3659, 7244, 10086, 19195, 48341, 116599, 155037, 356168, 609236, 792905, 1716485, 2832213, 5887815, 15116625, 23911833, 29983570, 46873052, 58443395, 90374471, 394641602, 593224103, 1082063335, 1318608063, 3477935702, 4207389268, 7398721009, 12885091292, 18555597522, 31831360281, 54145147464, 64517020844
Offset: 1

Views

Author

Marc LeBrun and N. J. A. Sloane, Aug 07 2015

Keywords

Examples

			For n=4, the fourth prime is 7, and we see the three partitions 7=2+5=2+2+3=3+4, so a(4)=3.
		

Crossrefs

This is A098743(prime(n)). Cf. A260797.

Programs

  • Haskell
    import Data.MemoCombinators (memo2, integral)
    a260798 n = a260798_list !! (n-1)
    a260798_list = map (subtract 1 . pMemo 2) a000040_list where
       pMemo = memo2 integral integral p
       p _ 0 = 1
       p k m | m < k     = 0
             | otherwise = pMemo k (m - k) + pMemo (k + 1) m
    -- Reinhard Zumkeller, Aug 09 2015
  • Maple
    b:= proc(n, i) option remember; `if`(n=0 or i=2, 1-irem(n, 2),
          `if`(i<2, 0, b(n, i-1)+b(n-i, min(i, n-i))))
        end:
    a:= n-> (p-> b(p, p-1))(ithprime(n)):
    seq(a(n), n=1..45);  # Alois P. Heinz, Mar 11 2018
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0 || i == 2, 1 - Mod[n, 2], If[i < 2, 0, b[n, i - 1] + b[n - i, Min[i, n - i]]]];
    a[n_] := b[#, # - 1]&[Prime[n]];
    Table[a[n], {n, 1, 45}] (* Jean-François Alcover, May 20 2018, after Alois P. Heinz *)