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.

Showing 1-2 of 2 results.

A078465 Primonacci numbers: a(n)=a(n-2)+a(n-3)+a(n-5)+a(n-7)+a(n-11)+...+a(n-p(k))+... until n <= p(k), where p(k) is the k-th prime. a(1)=a(2)=1.

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 5, 8, 12, 16, 26, 36, 55, 81, 118, 177, 257, 384, 564, 833, 1233, 1813, 2685, 3956, 5845, 8629, 12731, 18807, 27746, 40976, 60481, 89282, 131816, 194562, 287253, 424018, 625968, 924077
Offset: 1

Views

Author

Miklos Kristof, Jan 02 2003

Keywords

Comments

a(n)/a(n-1) -> 1.476229...=1/x, where x satisfies the Sum x^p(n)=1 equation, i.e. x^2+x^3+x^5+x^7+x^11+... =1. (What constant is it?)

Examples

			a(12) = 36 = a(12-2)+a(12-3)+a(12-5)+a(12-7)+a(12-11) = a(10)+a(9)+a(7)+a(5)+a(1) = 16+12+5+2+1 = 36.
		

Crossrefs

Cf. A078974 (the constant 1.47622...), A084256 (the constant 1/1.47622...)

Programs

  • Haskell
    import Data.List (genericIndex)
    a078465 n = a078465_list `genericIndex` (n-1)
    a078465_list = 1 : 1 : f 3 where
       f x = (sum $ map (a078465 . (x -)) $
             takeWhile (< x) a000040_list) : f (x + 1)
    -- Reinhard Zumkeller, Jul 20 2012
  • Mathematica
    a[1] = a[2] = 1; a[n_] := a[n] = Sum[a[n - Prime[k]], {k, 1, PrimePi[n]}]; Table[a[n], {n, 1, 38}] (* Jean-François Alcover, Mar 22 2011 *)

Extensions

Name corrected by Sean A. Irvine, Jul 01 2025

A359388 a(n) is the number of compositions of n into prime parts, with the 1st part equal to 2, the 2nd part less than or equal to 3, ..., and the k-th part less than or equal to prime(k), and so on.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 1, 2, 2, 4, 5, 7, 11, 15, 24, 33, 50, 73, 105, 159, 229, 342, 501, 738, 1094, 1604, 2378, 3499, 5166, 7627, 11243, 16610, 24494, 36165, 53376, 78775, 116301, 171642, 253398, 374034, 552139, 815079, 1203166, 1776174, 2621938, 3870572, 5713798, 8434744
Offset: 0

Views

Author

Stefano Spezia, Dec 29 2022

Keywords

Examples

			The 7 such compositions of n = 11 are:
[ 1]  (2, 2, 2, 2, 3);
[ 2]  (2, 2, 2, 3, 2);
[ 3]  (2, 2, 3, 2, 2);
[ 4]  (2, 3, 2, 2, 2);
[ 5]  (2, 2, 2, 5);
[ 6]  (2, 2, 5, 2);
[ 7]  (2, 3, 3, 3).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, add(
          b(n-ithprime(j), i+1), j=1..min(i, numtheory[pi](n))))
        end:
    a:= n-> b(n, 1):
    seq(a(n), n=0..50);  # Alois P. Heinz, Dec 29 2022
  • Mathematica
    a[n_]:=Coefficient[Expand[Sum[Product[Sum[x^Prime[i], {i, k}], {k,m}], {m, 0,Floor[n/2]}]],x,n]; Array[a,48,0]

Formula

G.f.: Sum_{m>=0} Product_{k=1..m} Sum_{i=1..k} x^prime(i).
a(n) ~ c*A078974^n, where c = 0.094587447... .
Showing 1-2 of 2 results.