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.

A129363 Number of partitions of 2n into the sum of two twin primes.

Original entry on oeis.org

0, 0, 1, 1, 2, 1, 2, 2, 2, 2, 3, 3, 2, 1, 2, 2, 3, 3, 2, 1, 2, 2, 3, 4, 2, 1, 2, 1, 2, 3, 3, 2, 2, 1, 2, 4, 3, 3, 4, 2, 2, 3, 2, 2, 4, 2, 0, 0, 0, 2, 4, 3, 2, 2, 2, 4, 6, 3, 3, 5, 3, 1, 2, 1, 2, 4, 2, 1, 2, 2, 4, 5, 3, 2, 4, 3, 3, 4, 2, 2, 4, 2, 3, 6, 3, 1, 2, 1, 3, 6, 4, 2, 2, 1, 2, 4, 3, 4, 6, 4, 4, 5, 3, 6, 12
Offset: 1

Views

Author

T. D. Noe, Apr 11 2007

Keywords

Comments

a(n/2)=0 for the n in A007534. The logarithmic plot of this sequence seems very regular after 200000 terms.

Examples

			a(11)=3 because 22 = 3+19 = 5+17 = 11+11.
		

Crossrefs

Cf. A175931 (n for which a(n-1), a(n), a(n+1) are equal).

Programs

  • Haskell
    a129363 n = sum $ map (a164292 . (2*n -)) $ takeWhile (<= n) a001097_list
    -- Reinhard Zumkeller, Feb 03 2014
  • Mathematica
    nn=1000; tw=Select[Prime[Range[PrimePi[nn]]], PrimeQ[ #+2]&]; tw=Union[tw,tw+2]; tc=Table[0,{nn}]; tc[[tw]]=1; Table[cnt=0; k=1; While[tw[[k]]<=n/2, cnt=cnt+tc[[n-tw[[k]]]]; k++ ]; cnt, {n,2,nn,2}]

Formula

a(n) = Sum_{i=1..n} ceiling((A010051(i+2) + A010051(i-2))/2) * ceiling((A010051(2n-i+2) + A010051(2n-i-2))/2) * A010051(2n-i) * A010051(i). - Wesley Ivan Hurt, Jan 30 2014
a(n) = sum(A164292(2*n - A001097(k)): A001097(k) <= n). - Reinhard Zumkeller, Feb 03 2014

Extensions

Comment converted to crossref by Klaus Brockhaus, Oct 27 2010

A175940 Number of ways of writing n=p+f with p a prime and f a factorial.

Original entry on oeis.org

0, 0, 1, 2, 1, 1, 1, 2, 2, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 2, 1, 2, 1, 1, 0, 2, 0, 2, 1, 1, 0, 1, 1, 3, 1, 1, 0, 2, 1, 2, 0, 0, 0, 2, 1, 2, 0, 0, 0, 1, 1, 2, 1, 1, 0, 2, 0, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 2, 0, 1, 1, 1, 0, 1, 1, 3, 0, 0, 0, 1, 1, 2, 0, 0, 0, 2, 0, 1, 1, 1, 0, 0, 1, 3, 1, 1
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 25 2010

Keywords

Comments

Number of partitions of n into the sum of a prime number and a factorial number. Number of decompositions of n into an unordered sum of a prime number and a factorial number.

Examples

			a(29)=2 because 29 has two prime + factorial representations, 5+4! and 23+3!.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local t,k;
           t:= 0;
           for k while k! < n do
             if isprime(n-k!) then t:= t+1 fi
           od;
           t
    end proc:
    seq(a(n), n=1..100); # Robert Israel, Oct 13 2014
  • Mathematica
    a[n_] := Module[{t = 0, k}, For[k = 1, k! < n, k++, If[PrimeQ[n - k!] , t++]]; t];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Feb 02 2023, after Robert Israel *)
  • PARI
    a(n) = c=0;for(i=1,n,if(isprime(n-i!),c++));c
    vector(100,n,a(n)) \\ Derek Orr, Oct 13 2014

Extensions

Edited and entries checked by D. S. McNeil, Nov 26 2010
Showing 1-2 of 2 results.