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-10 of 17 results. Next

A024935 Duplicate of A051034.

Original entry on oeis.org

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

Views

Author

Keywords

Extensions

a(2)-a(6) prepended by Sean A. Irvine, Jul 29 2019

A174799 Partial sums of A051034.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 10, 12, 14, 15, 17, 18, 20, 22, 24, 25, 27, 28, 30, 32, 34, 35, 37, 39, 41, 44, 46, 47, 49, 50, 52, 54, 56, 59, 61, 62, 64, 66, 68, 69, 71, 72, 74, 76, 78, 79, 81, 83, 85, 88, 90, 91, 93, 95, 97, 100, 102, 103, 105, 106, 108, 110, 112, 115, 117, 118, 120, 122, 124, 125, 127, 128, 130, 132, 134, 137, 139, 140, 142, 144, 146, 147, 149, 151, 153, 156, 158, 159, 161, 163, 165, 168, 170, 173, 175, 176, 178, 180, 182, 183, 185, 186, 188, 190, 192, 193, 195, 196, 198, 200, 202
Offset: 2

Views

Author

Jonathan Vos Post, Nov 30 2010

Keywords

Crossrefs

Cf. A051034.

Formula

a(n) = Sum_{i=2..n} A051034(i).

A000607 Number of partitions of n into prime parts.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 9, 10, 12, 14, 17, 19, 23, 26, 30, 35, 40, 46, 52, 60, 67, 77, 87, 98, 111, 124, 140, 157, 175, 197, 219, 244, 272, 302, 336, 372, 413, 456, 504, 557, 614, 677, 744, 819, 899, 987, 1083, 1186, 1298, 1420, 1552, 1695, 1850, 2018, 2198, 2394, 2605, 2833, 3079, 3344
Offset: 0

Views

Author

Keywords

Comments

a(n) gives the number of values of k such that A001414(k) = n. - Howard A. Landman, Sep 25 2001
Let W(n) = {prime p: There is at least one number m whose spf is p, and sopfr(m) = n}. Let V(n,p) = {m: sopfr(m) = n, p belongs to W(n)}. Then a(n) = sigma(|V(n,p)|). E.g.: W(10) = {2,3,5}, V(10,2) = {30,32,36}, V(10,3) = {21}, V(10,5) = {25}, so a(10) = 3+1+1 = 5. - David James Sycamore, Apr 14 2018
From Gus Wiseman, Jan 18 2020: (Start)
Also the number of integer partitions such that the sum of primes indexed by the parts is n. For example, the sum of primes indexed by the parts of the partition (3,2,1,1) is prime(3)+prime(2)+prime(1)+prime(1) = 12, so (3,2,1,1) is counted under a(12). The a(2) = 1 through a(14) = 10 partitions are:
1 2 11 3 22 4 32 41 33 5 43 6 44
21 111 31 221 222 42 322 331 51 52
211 1111 311 321 411 421 332 431
2111 2211 2221 2222 422 3222
11111 3111 3211 3221 3311
21111 22111 4111 4211
111111 22211 22221
31111 32111
211111 221111
1111111
(End)

Examples

			n = 10 has a(10) = 5 partitions into prime parts: 10 = 2 + 2 + 2 + 2 + 2 = 2 + 2 + 3 + 3 = 2 + 3 + 5 = 3 + 7 = 5 + 5.
n = 15 has a(15) = 12 partitions into prime parts: 15 = 2 + 2 + 2 + 2 + 2 + 2 + 3 = 2 + 2 + 2 + 3 + 3 + 3 = 2 + 2 + 2 + 2 + 2 + 5 = 2 + 2 + 2 + 2 + 7 = 2 + 2 + 3 + 3 + 5 = 2 + 3 + 5 + 5 = 2 + 3 + 3 + 7 = 2 + 2 + 11 = 2 + 13 = 3 + 3 + 3 + 3 + 3 = 3 + 5 + 7 = 5 + 5 + 5.
		

References

  • R. Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; see p. 203.
  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem, Mathematics and Computer Education, Vol. 31, No. 1, pp. 24-28, Winter 1997. MathEduc Database (Zentralblatt MATH, 1997c.01891).
  • B. C. Berndt and B. M. Wilson, Chapter 5 of Ramanujan's second notebook, pp. 49-78 of Analytic Number Theory (Philadelphia, 1980), Lect. Notes Math. 899, 1981, see Entry 29.
  • D. M. Burton, Elementary Number Theory, 5th ed., McGraw-Hill, 2002.
  • L. M. Chawla and S. A. Shad, On a trio-set of partition functions and their tables, J. Natural Sciences and Mathematics, 9 (1969), 87-96.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

G.f. = 1 / g.f. for A046675. See A046113 for the ordered (compositions) version.
Row sums of array A116865 and of triangle A261013.
Column sums of A331416.
Partitions whose Heinz number is divisible by their sum of primes are A330953.
Partitions of whose sum of primes is divisible by their sum are A331379.

Programs

  • Haskell
    a000607 = p a000040_list where
       p _      0 = 1
       p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Aug 05 2012
    
  • Magma
    [1] cat [#RestrictedPartitions(n,{p:p in PrimesUpTo(n)}): n in [1..100]]; // Marius A. Burtea, Jan 02 2019
  • Maple
    with(gfun):
    t1:=mul(1/(1-q^ithprime(n)),n=1..51):
    t2:=series(t1,q,50):
    t3:=seriestolist(t2); # fixed by Vaclav Kotesovec, Sep 14 2014
  • Mathematica
    CoefficientList[ Series[1/Product[1 - x^Prime[i], {i, 1, 50}], {x, 0, 50}], x]
    f[n_] := Length@ IntegerPartitions[n, All, Prime@ Range@ PrimePi@ n]; Array[f, 57] (* Robert G. Wilson v, Jul 23 2010 *)
    Table[Length[Select[IntegerPartitions[n],And@@PrimeQ/@#&]],{n,0,60}] (* Harvey P. Dale, Apr 22 2012 *)
    a[n_] := a[n] = If[PrimeQ[n], 1, 0]; c[n_] := c[n] = Plus @@ Map[# a[#] &, Divisors[n]]; b[n_] := b[n] = (c[n] + Sum[c[k] b[n - k], {k, 1, n - 1}])/n; Table[b[n], {n, 1, 20}] (* Thomas Vogler, Dec 10 2015: Uses Euler transform, caches computed values, faster than IntegerPartitions[] function. *)
    nmax = 100; pmax = PrimePi[nmax]; poly = ConstantArray[0, nmax + 1]; poly[[1]] = 1; poly[[2]] = 0; poly[[3]] = -1; Do[p = Prime[k]; Do[poly[[j + 1]] -= poly[[j + 1 - p]], {j, nmax, p, -1}];, {k, 2, pmax}]; s = Sum[poly[[k + 1]]*x^k, {k, 0, Length[poly] - 1}]; CoefficientList[Series[1/s, {x, 0, nmax}], x] (* Vaclav Kotesovec, Jan 11 2021 *)
  • PARI
    N=66;x='x+O('x^N); Vec(1/prod(k=1,N,1-x^prime(k))) \\ Joerg Arndt, Sep 04 2014
    
  • Python
    from sympy import primefactors
    l = [1, 0]
    for n in range(2, 101):
        l.append(sum(sum(primefactors(k)) * l[n - k] for k in range(1, n + 1)) // n)
    l  # Indranil Ghosh, Jul 13 2017
    
  • Sage
    [Partitions(n, parts_in=prime_range(n + 1)).cardinality() for n in range(100)]  # Giuseppe Coppoletta, Jul 11 2016
    

Formula

Asymptotically a(n) ~ exp(2 Pi sqrt(n/log n) / sqrt(3)) (Ayoub).
a(n) = (1/n)*Sum_{k=1..n} A008472(k)*a(n-k). - Vladeta Jovovic, Aug 27 2002
G.f.: 1/Product_{k>=1} (1-x^prime(k)).
See the partition arrays A116864 and A116865.
From Vaclav Kotesovec, Sep 15 2014 [Corrected by Andrey Zabolotskiy, May 26 2017]: (Start)
It is surprising that the ratio of the formula for log(a(n)) to the approximation 2 * Pi * sqrt(n/(3*log(n))) exceeds 1. For n=20000 the ratio is 1.00953, and for n=50000 (using the value from Havermann's tables) the ratio is 1.02458, so the ratio is increasing. See graph above.
A more refined asymptotic formula is found by Vaughan in Ramanujan J. 15 (2008), pp. 109-121, and corrected by Bartel et al. (2017): log(a(n)) = 2*Pi*sqrt(n/(3*log(n))) * (1 - log(log(n))/(2*log(n)) + O(1/log(n))).
See Bartel, Bhaduri, Brack, Murthy (2017) for a more complete asymptotic expansion. (End)
G.f.: 1 + Sum_{i>=1} x^prime(i) / Product_{j=1..i} (1 - x^prime(j)). - Ilya Gutkovskiy, May 07 2017
a(n) = A184198(n) + A184199(n). - Vaclav Kotesovec, Jan 11 2021

A025583 Composite numbers that are not the sum of 2 primes.

Original entry on oeis.org

27, 35, 51, 57, 65, 77, 87, 93, 95, 117, 119, 121, 123, 125, 135, 143, 145, 147, 155, 161, 171, 177, 185, 187, 189, 203, 205, 207, 209, 215, 217, 219, 221, 237, 245, 247, 249, 255, 261, 267, 275, 287, 289, 291, 297, 299, 301, 303, 305, 321, 323, 325, 327, 329, 335, 341
Offset: 1

Views

Author

Keywords

Comments

Goldbach conjectured that every integer > 5 is the sum of three primes.
Conjecture: This is the sequence of odd numbers k such that (k mod x) mod 2 != 1, where x is the greatest m <= k such that m, m-1 and m-2 are all composite. Verified for first 10000 terms. - Benedict W. J. Irwin, May 06 2016
Numbers k, such that however many of k coins are placed with heads rather than tails showing, either those showing heads or those showing tails can be arranged in a rectangular pattern with multiple rows and columns. (If the Goldbach conjecture for even numbers is false this comment should be restricted to the odd terms of this sequence, as it might otherwise define a variant sequence). - Peter Munn, May 15 2017

Crossrefs

Programs

  • Haskell
    a025583 n = a025583_list !! (n-1)
    a025583_list = filter f a002808_list where
       f x = all (== 0) $ map (a010051 . (x -)) $ takeWhile (< x) a000040_list
    -- Reinhard Zumkeller, Oct 15 2014
  • Mathematica
    f[n_] := (p = 0; pn = PrimePi[n]; Do[ If[n == Prime[i] + Prime[k], p = p + 1; If[p > 2, Break[]]], {i, 1, pn}, {k, i, pn}]; p ); Select[Range[2, 400], ! PrimeQ[#] && f[#] == 0 & ] (* Jean-François Alcover, Mar 07 2011 *)
    upto=350;With[{c=PrimePi[upto]},Complement[Range[4,upto], Prime[Range[ c]], Union[Total/@Tuples[Prime[Range[c]],{2}]]]] (* Harvey P. Dale, Jul 14 2011 *)
    Select[Range[400],CompositeQ[#]&&Count[IntegerPartitions[#,{2}],?(AllTrue[ #,PrimeQ]&)]==0&] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale, Feb 21 2021 *)

A330507 a(n) is the smallest number k having for every prime p <= prime(n) at least one prime partition with least part p, and no such partition having least part > prime(n). If no such k exists then a(n) = 0 (see comments).

Original entry on oeis.org

2, 6, 10, 18, 24, 30, 51, 57, 69, 60, 99, 111, 123, 143, 147, 159, 177, 189, 201, 213, 225, 245, 255, 267, 291, 303, 309, 321, 345, 357, 381, 393, 411, 427, 447, 465, 471, 493, 507, 519, 537, 553, 573, 583, 623, 621, 633, 669, 681, 695, 707, 729, 749, 753, 783
Offset: 1

Views

Author

David James Sycamore, Mar 01 2020

Keywords

Comments

Alternatively, a(n) is the smallest number whose product of distinct least part primes from all partitions of n into prime parts, is equal to primorial(n).
2 is the only prime term.
a(n) = 0 for n = 90, 151, 349, 352, 444, ... . - Alois P. Heinz, Mar 12 2020

Examples

			a(1) = 2 because [2] is the only prime partition of prime(1) = 2.
a(2) = 6 because [2,2,2] and [3,3] are the only possible prime partitions of 6, namely with prime(1) and prime(2) the only least parts.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, p, t) option remember; `if`(n=0, 1, `if`(p>n, 0, (q->
          add(b(n-p*j, q, 1), j=1..n/p)*t^p+b(n, q, t))(nextprime(p))))
        end:
    a:= proc(n) option remember; local f, k, p; p:= ithprime(n);
          for k to 4*p do f:= b(k, 2, x); if degree(f)<= p and andmap(
            h->0Alois P. Heinz, Mar 12 2020
  • Mathematica
    With[{s = Array[Union@ Select[IntegerPartitions[#], AllTrue[#, PrimeQ] &][[All, -1]] &, 70]}, TakeWhile[Map[FirstPosition[s, #][[1]] &, Rest@ NestList[Append[#, Prime[Length@ # + 1]] &, {}, 12]], IntegerQ]] (* Michael De Vlieger, Mar 06 2020 *)
    (* Second program: *)
    Block[{a, m = 125, s}, a = ConstantArray[{}, m]; s = {Prime@ PrimePi@ m}; Do[If[# <= m, If[FreeQ[a[[#]], Last@ s], a = ReplacePart[a, # -> Union@ Append[a[[#]], Last@ s]], Nothing]; AppendTo[s, Last@ s], If[Last@ s == 2, s = DeleteCases[s, 2]; If[Length@ s == 0, Break[], s = MapAt[Prime[PrimePi[#] - 1] &, s, -1]], s = MapAt[Prime[PrimePi[#] - 1] &, s, -1]]] &@ Total[s], {i, Infinity}]; TakeWhile[Map[FirstPosition[a, #][[1]] &, Rest@ NestList[Append[#, Prime[Length@ # + 1]] &, {}, Max[Length /@ a]]], IntegerQ]] (* Michael De Vlieger, Mar 11 2020 *)

Extensions

a(19)-a(21) from Michael De Vlieger, Mar 12 2020
a(22)-a(55) from Alois P. Heinz, Mar 12 2020

A072491 Define f(1) = 0. For n>=2, let f(n) = n - p where p is the largest prime <= n. a(n) = number of iterations of f to reach 0, starting from n.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Jul 14 2002

Keywords

Comments

a(p)=1, a(p+1)=2 and a(p+4)=3 if p is an odd prime but p+2 and p+4 are composite.
Number of noncomposites (A008578) needed to sum to n using the greedy algorithm. - Antti Karttunen, Aug 09 2015

Examples

			a(27)=3 as f(27)=27-23=4, f(4)=4-3=1 and f(1)=0.
		

References

  • S. S. Pillai, "An arithmetical function concerning primes", Annamalai University Journal (1930), pp. 159-167.

Crossrefs

Cf. A008578, A072492. A066352(n) is the smallest k such that a(k)=n.
Not the same as A051034: a(122) = 3, but A051034(122) = 2.

Programs

  • Mathematica
    f[1]=0; f[n_] := n-Prime[PrimePi[n]]; a[n_] := Module[{k, x}, For[k=0; x=n, x>0, k++; x=f[x], Null]; k]
  • PARI
    a(n)=if(n<4,n>0,1+a(n-precprime(n))) \\ Charles R Greathouse IV, Feb 04 2013

Formula

On Cramér's conjecture, a(n) = O(log* n). - Charles R Greathouse IV, Feb 04 2013

Extensions

Edited by Dean Hickerson, Nov 26 2002
a(0) = 0 prepended by Antti Karttunen, Aug 09 2015

A096436 a(n) = the number of squared primes and 1's needed to sum to n.

Original entry on oeis.org

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

Views

Author

Tom Raes (tommy1729(AT)hotmail.com), Aug 10 2004

Keywords

Comments

a(n) has a new maximum at n=1,2,3,7,24,73,266,795.
I suspect that a(n) <= 9 for all n. - Robert G. Wilson v, Sep 18 2004

Examples

			a(5) = 2 because 5=4+1.
a(17) = 3 because 17=9+4+4.
A number may have many such sums: 27=25+1+1=9+9+9, 50=25+25=49+1.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{d = n, k = PrimePi[ Sqrt[n]], sp = {}}, While[d > 3, While[p = Prime[k]; d >= p^2, AppendTo[sp, p]; d = d - p^2]; k-- ]; While[d != 0, AppendTo[sp, 1]; d = d - 1]; If[Position[sp, 3] != {} && sp[[ -3]] == 1, sp = Delete[Drop[sp, -3], Position[sp, 3][[1]]]; AppendTo[sp, {2, 2, 2}]]; Reverse[ Sort[ Flatten[ sp]]]]; Table[ Length[ f[n]], {n, 105}] (* Robert G. Wilson v, Sep 20 2004 *)

Extensions

Edited and extended by Robert G. Wilson v, Sep 18 2004
Edited by Don Reble, Apr 23 2006

A101422 Minimal number of primes needed to sum to Fibonacci(n).

Original entry on oeis.org

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

Views

Author

Giovanni Teofilatto, Jan 17 2005

Keywords

Examples

			a(5)=1 because Fibonacci(5)=5 is a prime.
a(6)=2 because Fibonacci(6)=8 = 3+5.
a(7)=1 because Fibonacci(7)=13 is a prime.
a(14)=3 because Fibonacci(14)=377 = 2+2+373.
		

Crossrefs

Formula

a(n) = A051034(A000045(n)).

Extensions

Edited and extended by Ray Chandler, Jan 18 2005

A087942 Number of partitions of n into as many primes as n has prime factors.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 7, 1, 3, 7, 3, 1, 2, 1, 11, 1, 4, 0, 15, 1, 2, 1, 21, 1, 3, 1, 4, 12, 4, 1, 26, 1, 5, 0, 4, 1, 33, 1, 38, 0, 4, 1, 41, 1, 3, 19, 137, 0, 5, 1, 6, 1, 2, 1, 61, 1, 5, 22, 5, 0, 5, 1, 67, 24, 5, 1, 81, 1, 5, 0, 96, 1, 93, 1, 9, 0
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 27 2003

Keywords

Comments

Conjecture, for m>1: a(m)=0 iff n is an odd semiprime such that m-2 is not prime, i.e. m=A089268(k) for some k. - Reinhard Zumkeller, Oct 28 2003

Examples

			n=20 = 2*2*5 = 13+5+2 = 11+7+2, all other partitions into 3 primes have fewer than or more than 3 parts, therefore a(20)=2.
		

Crossrefs

Programs

A103765 Number of times n can be written as sum of a minimal set of primes.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 6, 2, 1, 3, 1, 2, 1, 4, 7, 4, 1, 2, 1, 3, 1, 4, 1, 3, 1, 4, 1, 5, 1, 4, 14, 3, 1, 5, 1, 3, 16, 4, 1, 6, 1, 3, 1, 5, 20, 6, 1, 2, 1, 5, 1, 6, 1, 5, 1, 5, 27, 7, 1, 4, 1, 5, 1, 8, 1, 5, 28, 4, 1, 9, 1, 4, 32, 5, 35, 7, 1, 3, 1, 6, 1, 8, 1
Offset: 2

Views

Author

Reinhard Zumkeller, Mar 29 2005

Keywords

Comments

A051034 gives the minimal number of primes needed to sum to n;
a(A000040(n)) = 1; a(2*k) = A002375(k) for k>2.

Examples

			A051034(25) = 2: a(25) = #{2+23}=1;
A051034(26) = 2: a(26) = #{3+23, 7+19, 13+13} = 3;
A051034(27) = 3: a(27) = #{3+5+19, 3+7+17, 3+11+13, 5+5+17,
5+11+11, 7+7+13} = 6;
A051034(28) = 2: a(28) = #{5+23, 11+17} = 2;
A051034(29) = 1: a(29) = #{29} = 1.
		
Showing 1-10 of 17 results. Next