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 18 results. Next

A208244 Number of ways to write n as the sum of a practical number (A005153) and a triangular number (A000217).

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 11 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>0.
The author has verified this for n up to 10^8, and also guessed the following refinement: If n>6 is not among 20, 104, 272, 464, 1664, then n can be written as p+q with p an even practical number and q a positive triangular number.
Somu and Tran (2024) proved the conjecture that a(n)>0 for n>0. - Duc Van Khanh Tran, Apr 24 2024

Examples

			a(15)=1 since 15=12+3 with 12 a practical number and 3 a triangular number.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=FactorInteger[n]
    Pow[n_,i_]:=Pow[n,i]=Part[Part[f[n],i],1]^(Part[Part[f[n],i],2])
    Con[n_]:=Con[n]=Sum[If[Part[Part[f[n],s+1],1]<=DivisorSigma[1,Product[Pow[n,i],{i,1,s}]]+1,0,1],{s,1,Length[f[n]]-1}]
    pr[n_]:=pr[n]=n>0&&(n<3||Mod[n,2]+Con[n]==0)
    a[n_]:=a[n]=Sum[If[pr[n-k(k+1)/2]==True,1,0],{k,0,(Sqrt[8n+1]-1)/2}]
    Do[Print[n," ",a[n]],{n,1,100}]

A076768 Positive integers not expressible as the sum of a prime and a triangular number.

Original entry on oeis.org

1, 36, 105, 171, 210, 216, 325, 351, 406, 528, 561, 630, 741, 780, 990, 1081, 1176, 1275, 1596, 1711, 1830, 1953, 2016, 2145, 2346, 2628, 2775, 3003, 3081, 3240, 3321, 3655, 3741, 3916, 4278, 4371, 4465, 4560, 4851, 5253, 5460, 5565, 5886, 6105, 6216, 6786, 7021, 7140, 7503, 7626, 7750, 7875, 8256, 8515, 8911, 9045, 9591, 9870
Offset: 1

Views

Author

Jason Earls, Nov 14 2002

Keywords

Comments

It appears that 1,2,3,8 are the only positive integers that cannot be partitioned as the sum of a semiprime and a triangular number. Here triangular numbers include t(0)=0 and t(1)=1. - Jonathan Vos Post and Ray Chandler, Nov 28 2004
This sequence contains 216 (and possibly other nontriangular numbers) together with an infinite number of triangular numbers. The indices of the triangular numbers are in A138666. This is related to the Sun's conjecture (see A132399) that every number except 216 is the sum of a triangular number and a prime or 0. - T. D. Noe, Mar 26 2008

Examples

			a(2) = 36 is an element of this sequence because 36 cannot be written as a sum of one of the primes <= 36 {2,3,5,7,11,13,17,19,23,29,31} and one of the triangular numbers <= 36 {1,3,6,10,15,21,28,36}. - corrected (added 28) by _Gionata Neri_, May 02 2015
		

Crossrefs

Programs

  • Mathematica
    Complement[Range[9871],Total/@Tuples[{Prime[Range[1220]],Accumulate[ Range[ 0,140]]}]] (* Harvey P. Dale, Jul 30 2019 *)

Extensions

Added the terms 6786 through 9870 and conjecture that there are no further terms - Jonathan Vos Post and Ray Chandler, Nov 28 2004
Added "positive" to the name - Alex Ratushnyak, Apr 04 2013

A144590 Number of ordered ways of writing 2n+1 = i + j, where i is a prime and j is of the form k*(k+1), k > 0.

Original entry on oeis.org

0, 0, 1, 1, 2, 1, 2, 2, 2, 3, 1, 3, 4, 1, 2, 3, 3, 3, 3, 2, 2, 5, 2, 3, 6, 1, 4, 3, 1, 5, 5, 3, 3, 4, 2, 3, 7, 3, 3, 6, 2, 4, 6, 2, 4, 5, 3, 5, 3, 3, 5, 8, 1, 2, 9, 1, 7, 7, 3, 5, 5, 3, 3, 5, 4, 4, 7, 2, 4, 8, 2, 7, 5, 2, 4, 8, 3, 4, 6, 4, 6, 7, 2, 2, 12, 2, 6, 5, 2, 8, 5, 4, 6, 7, 2, 4, 11, 3, 4, 10, 3, 7, 6, 2
Offset: 0

Views

Author

N. J. A. Sloane, Jan 15 2009

Keywords

Comments

Based on a posting by Zhi-Wei Sun to the Number Theory Mailing List, Mar 23 2008, where he conjectures that a(n) > 0 for n >= 2.
Zhi-Wei Sun has offered a monetary reward for settling this conjecture.
No counterexample exists below 10^10 (D. S. McNeil).

References

  • Zhi-Wei Sun, On sums of primes and triangular numbers, Journal of Combinatorics and Number Theory, 1(2009), no.1, 65-76.

Crossrefs

Cf. A132399. Bisection of A117054.

A229166 Number of ordered ways to write n = x*(x+1)/2 + y with y*(y+1)/2 + 1 prime, where x and y are nonnegative integers.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Oct 15 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0. Moreover, if n > 0 is not among 1, 3, 60, then there are positive integers x and y with x*(x+1)/2 + y = n such that y*(y+1)/2 + 1 is prime.

Examples

			a(6) = 1 since 6 = 2*3/2 + 3 with 3*4/2 + 1 = 7 prime.
a(60) = 1 since 60 = 0*1/2 + 60 with 60*61/2 + 1 = 1831 prime.
		

Crossrefs

Programs

  • Mathematica
    T[n_]:=n(n+1)/2
    a[n_]:=Sum[If[PrimeQ[T[n-T[i]]+1],1,0],{i,0,(Sqrt[8n+1]-1)/2}]
    Table[a[n],{n,1,100}]

A230596 Number of ways to write n = x + y + z with 0 < x <= y <= z such that x*y*z is a triangular number, and that x is a triangular number of the form (p^2 - 1)/8 with p an odd prime.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 0, 2, 1, 1, 2, 2, 1, 1, 2, 2, 4, 1, 1, 2, 3, 2, 5, 1, 3, 3, 3, 3, 2, 8, 1, 4, 2, 2, 3, 5, 1, 3, 6, 3, 5, 3, 1, 6, 4, 5, 3, 3, 1, 6, 6, 3, 4, 2, 4, 3, 8, 3, 3, 8, 5, 2, 4, 4, 6, 6, 3, 6, 2, 3, 12, 7, 1, 10, 7, 3, 4, 5, 3, 7, 8, 2, 5, 4, 6, 4, 2, 5, 6, 6, 4, 4, 13, 6, 9, 6, 4, 10, 7, 4
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 24 2013

Keywords

Comments

Conjecture: (i) a(n) > 0 except for n = 1, 2, 4, 7.
(ii) For any integer n > 7, there are positive integers x, y, z with x + y + z = n such that x*y*z is a triangular number and x is among 1, 2, 3, 4, 5, 6.
Note that a(3k) and a(3k+2) are positive for every k = 1, 2, 3, .... In fact, 3k = 1 + k + (2k-1) with 1*k*(2k-1) = 2k*(2k-1)/2 a triangular number, and 3k+2 = 1 + k + (2k+1) with 1*k*(2k+1) = 2k(2k+1)/2 a triangular number.

Examples

			a(10) = 1 since 10 = 3 + 3 + 4, and 3 = (5^2-1)/8 with 5 an odd prime, and 3*3*4 = 8*9/2 is a triangular number.
a(31) = 1 since 31 = 3 + 11 + 17, and 3 = (5^2-1)/8 with 5 an odd prime, and 3*11*17 = 33*34/2 is a triangular number.
		

Crossrefs

Programs

  • Mathematica
    TQ[n_]:=IntegerQ[Sqrt[8n+1]]
    a[n_]:=Sum[If[TQ[(Prime[i]^2-1)/8*y*(n-(Prime[i]^2-1)/8-y)],1,0],{i,2,PrimePi[Sqrt[8n/3+1]]},{y,(Prime[i]^2-1)/8,(n-(Prime[i]^2-1)/8)/2}]
    Table[a[n],{n,1,100}]

A256071 Number of ordered ways to write n = p + x*(3*x-1)/2, where p is prime or zero, and x is an integer.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 13 2015

Keywords

Comments

Conjecture: a(n) > 0 for all n. Moreover, each nonnegative integer n is either an odd prime, or a generalized pentagonal number, or the sum of an odd prime and a generalized pentagonal number.
This is similar to the author's earlier conjecture on sums of primes and triangular numbers (see the reference and also A132399).
The conjecture has been verified for all n = 0..10^9.

Examples

			a(11) = 1 since 11 = 11 + 0*(3*0-1)/2 with 11 prime.
a(15) = 1 since 15 = 0 + (-3)*(3*(-3)-1)/2.
a(50) = 1 since 50 = 43 + (-2)*(3*(-2)-1)/2 with 43 prime.
		

References

  • Zhi-Wei Sun, On sums of primes and triangular numbers, J. Comb. Number Theory 1(2009), 65-76.

Crossrefs

Programs

  • Mathematica
    P[n_]:=(n==0)||PrimeQ[n]
    Do[r=0;Do[If[P[n-x(3x-1)/2],r=r+1],{x,-Floor[(Sqrt[24n+1]-1)/6],Floor[(Sqrt[24n+1]+1)/6]}];Print[n," ",r];Label[aa];Continue,{n,0,100}]
  • PARI
    a(n)=if(n==0, return(1)); sum(x=1,(1+sqrt(24*n+1))\6, isprime(n-x*(3*x-1)/2))+sum(x=0,(sqrt(24*n+1)-1)\6, isprime(n-x*(3*x+1)/2))+ispolygonal(n,5)+(x->3*x^2+x==2*n)(round((sqrt(24*n+1)-1)/6)) \\ Charles R Greathouse IV, Apr 07 2015

A154752 Least prime p (or 0) such that n = p + T, where T is a triangular number (A000217), or -1 if there is no such representation.

Original entry on oeis.org

0, 2, 0, 3, 2, 0, 7, 2, 3, 0, 5, 2, 3, 11, 0, 13, 2, 3, 13, 5, 0, 7, 2, 3, 19, 5, 17, 0, 19, 2, 3, 11, 5, 13, 7, 0, 31, 2, 3, 19, 5, 41, 7, 23, 0, 31, 2, 3, 13, 5, 23, 7, 17, 53, 0, 11, 2, 3, 23, 5, 61, 7, 53, 19, 29, 0, 31, 2, 3, 67, 5, 17, 7, 19, 47, 31, 11, 0, 13, 2, 3, 37, 5, 29, 7, 31, 59, 43
Offset: 1

Views

Author

T. D. Noe, Jan 17 2009

Keywords

Comments

Zhi-Wei Sun conjectures that only n=216 has no such representation. It appears that n = 2, 7, 61 and 211 are the only numbers for which the triangular number 0 is required in the representation (see A065397). When n is a triangular number, then a(n)=0. Sequence A132399 gives the number of representations of n as p+T. As n becomes larger, the largest prime required to verify the conjecture increases slowly. For example, for n<=10^3, the largest prime required is 953; for n<=10^6 it is 373361; for n<=10^9 it is only 36455351. Using primes less than 10^9, all n<243277591560 have been verified.

Examples

			n=p+T: 1=0+1; 2=2+0; 3=0+3; 4=3+1; 5=2+3; 6=0+6; 7=7+0; 8=2+6; 9=3+6; 10=0+10.
		

References

  • Zhi-Wei Sun, On sums of primes and triangular numbers, Journal of Combinatorics and Number Theory, 1(2009), no.1, 65-76.

Programs

  • Mathematica
    nn=300; s=0; tri=Rest[Reap[i=0; While[s1 && !PrimeQ[p], m-- ]; If[m==1 && !PrimeQ[p], -1, p]], {n,nn}]

Extensions

Offset in b-file corrected by N. J. A. Sloane, Aug 31 2009

A227877 Number of ways to write n = x + y + z (x, y, z > 0) such that x*y and x*z are triangular numbers, and 6*y-1 and 6*z+1 are both prime.

Original entry on oeis.org

0, 0, 1, 0, 3, 2, 2, 3, 3, 7, 3, 6, 3, 3, 2, 3, 7, 6, 7, 5, 4, 5, 10, 2, 10, 4, 5, 2, 2, 9, 5, 9, 2, 4, 3, 4, 5, 7, 5, 11, 12, 5, 8, 11, 12, 5, 11, 3, 7, 11, 4, 10, 6, 2, 9, 11, 8, 7, 9, 8, 9, 4, 3, 4, 10, 6, 9, 15, 9, 17, 3, 3, 8, 12, 10, 5, 1, 7, 9, 16, 8, 17, 6, 8, 16, 6, 8, 8, 10, 1, 6, 4, 8, 5, 23, 11, 2, 9, 6, 14
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 25 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 4.
For n = 4*k - 1, we have n = (2k-1) + k + k with (2k-1)*k = 2k*(2k-1)/2 a triangular number. For n = 4*k + 1, we have n = (2k+1) + k + k with (2k+1)*k = 2k*(2k+1)/2 a triangular number. For n = 4*k + 2, we have n = (2k+1) + k + (k+1), and (2k+1)*k = 2k*(2k+1)/2 and (2k+1)*(k+1) = (2k+1)(2k+2)/2 are both triangular numbers.
For n = 5*k, we have n = k + (2k-1) + (2k+1), and k*(2k-1) = 2k*(2k-1)/2 and k*(2k+1) = 2k*(2k+1)/2 are both triangular numbers. For n = 5*k - 2, we have n = k + (2k-1) + (2k-1) with k*(2k-1) = 2k*(2k-1)/2 a triangular number. For n = 5*k + 2, we have n = k + (2k+1) + (2k+1) with k*(2k+1) = 2k*(2k+1)/2 a triangular number.

Examples

			a(77) = 1 since 77 = 1 + 10 + 66, and 1*10 = 4*5/2 and 1*66 = 11*12/2 are triangular numbers, and 6*10 - 1 = 59 and 6*66 + 1 = 397 are both prime.
a(90) = 1 since 90 = 45 + 22 + 23, and 45*22 = 44*45/2 and 45*23 = 45*46/2 are triangular numbers, and 6*22 - 1 = 131 and 6*23 + 1 = 139 are both prime.
		

Crossrefs

Programs

  • Mathematica
    TQ[n_]:=IntegerQ[Sqrt[8n+1]]
    a[n_]:=Sum[If[PrimeQ[6j-1]&&PrimeQ[6(n-i-j)+1]&&TQ[i*j]&&TQ[i(n-i-j)],1,0],{i,1,n-2},{j,1,n-1-i}]
    Table[a[n],{n,1,100}]

A230451 Number of ways to write n = x + y + z (x, y, z > 0) such that 2*x + 1, 2*y + 3, 2*z + 5 are all prime and x*y*z is a triangular number.

Original entry on oeis.org

0, 0, 1, 0, 2, 3, 0, 4, 3, 1, 7, 3, 2, 3, 7, 4, 5, 6, 3, 4, 8, 5, 8, 3, 6, 8, 9, 9, 5, 12, 2, 11, 4, 4, 4, 13, 5, 9, 13, 8, 14, 8, 3, 15, 7, 8, 10, 6, 5, 17, 15, 4, 6, 9, 8, 10, 15, 9, 7, 15, 11, 5, 6, 11, 14, 14, 7, 11, 3, 12, 23, 16, 5, 20, 14, 4, 9, 14, 5, 19, 19, 4, 3, 12, 7, 16, 5, 12, 6, 11, 12, 12, 23, 14, 23, 12, 5, 17, 14, 5
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 19 2013

Keywords

Comments

Conjecture: (i) a(n) > 0 except for n = 1, 2, 4, 7.
(ii) Any integer n > 7 can be written as x + y + z (x, y, z > 0) such that 2*x + 1, 2*y + 1, 2*x*y + 1 are primes and x*y*z is a triangular number.
(iii) Each integer n > 4 not equal to 7 or 14 can be expressed as p + q + r (p, q, r > 0) with p and 2*q + 1 both primes, and p*q*r a triangular number.
(iv) Any integer n > 6 not among 16, 20, 60 can be written as x + y + z (x, y, z > 0) such that x*y + x*z + y*z is a triangular number.
Part (i) is stronger than Goldbach's weak conjecture which was finally proved by H. Helfgott in 2013.
See also A227877 and A230596 for some related conjectures.

Examples

			a(6) = 3 since 6 = 1 + 2 + 3 = 2 + 1 + 3 = 3 + 2 + 1, and 2*1 + 1 = 3, 2*2 + 3 = 7, 2*3 + 5 = 11, 2*2 + 1 = 5, 2*1 + 3 = 5, 2*3 + 1 = 7, 2*1 + 5 = 7 are all prime.
a(10) = 1 since 10 = 3 + 4 + 3, and 2*3 + 1 = 7, 2*4 + 3 = 11, 2*3 + 5 = 11 are all prime.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=IntegerQ[Sqrt[n]]
    TQ[n_]:=SQ[8n+1]
    a[n_]:=Sum[If[PrimeQ[2i+1]&&PrimeQ[2j+3]&&PrimeQ[2(n-i-j)+5]&&TQ[i*j(n-i-j)],1,0],{i,1,n-2},{j,1,n-1-i}]
    Table[a[n],{n,1,100}]

A090302 Begin with n and consider numbers obtained by successively subtracting 0, 1, 2, 3, ...; a(n) = largest prime that arises in the process, i.e., largest prime of the form n - T(r), where T(r) is the r-th triangular number; or 0 if no such number exists.

Original entry on oeis.org

0, 2, 3, 3, 5, 5, 7, 7, 3, 7, 11, 11, 13, 13, 5, 13, 17, 17, 19, 19, 11, 19, 23, 23, 19, 23, 17, 13, 29, 29, 31, 31, 23, 31, 29, 0, 37, 37, 29, 37, 41, 41, 43, 43, 17, 43, 47, 47, 43, 47, 41, 37, 53, 53, 19, 53, 47, 43, 59, 59, 61, 61, 53, 61, 59, 11, 67, 67, 59, 67, 71
Offset: 1

Views

Author

Amarnath Murthy, Nov 30 2003

Keywords

Comments

a(p) = p if p is a prime.

Crossrefs

Cf. A076768 (positions of 0's).
Cf. A132399.

Formula

Largest prime of the form n - r(r+1)/2.

Extensions

More terms from Frank Ellermann, Dec 03 2003
Showing 1-10 of 18 results. Next