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 10 results.

A132399 Number of ordered ways of writing n = i + j, where i is 0 or a prime and j is a triangular number (A000217) >= 0.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 23 2008

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 except for n = 216.
Zhi-Wei Sun has offered a monetary reward for settling this conjecture.
No counterexample below 10^10. - D. S. McNeil
Note that A076768 contains 216 and the numbers n whose only representation has 0 instead of a prime; all other integers appear to be the sum of a prime and a triangular number. Except for n=216, there is no other n < 2*10^9 for which a(n)=0.
It is clear that a(t) > 0 for any triangular number t because we always have the representation t = t+0. Triangular numbers tend to have only a few representations. Hence by not plotting a(n) for triangular n, the plot (see link) more clearly shows how a(n) slowly increases as n increases. This is more evidence that 216 is the only exception.
216 is the only exception less than 10^12. Let p(n) be the least prime (or 0 if n is triangular) such that n = p(n) + t(n), where t(n) is a triangular number. For n < 10^12, the largest value of p(n) is only 2297990273, which occurs at n=882560134401. - T. D. Noe, Jan 23 2009

Examples

			0 = 0+0, so a(0) = 1,
3 = 3+0 = 2+1 = 0+3, so a(3) = 3.
8 = 7+1 = 5+3 = 2+6, so a(8) = 3.
		

Crossrefs

Cf. A065397 (primes p whose only representation as the sum of a prime and a triangular number is p+0), A090302 (largest prime p for each n).
Cf. A154752 (smallest prime p for each n). - T. D. Noe, Jan 19 2009

Extensions

Corrected, edited and extended by T. D. Noe, Mar 26 2008
Edited by N. J. A. Sloane, Jan 15 2009

A138666 Numbers n such that every sum of consecutive positive numbers ending in n is not prime.

Original entry on oeis.org

1, 8, 14, 18, 20, 25, 26, 28, 32, 33, 35, 38, 39, 44, 46, 48, 50, 56, 58, 60, 62, 63, 65, 68, 72, 74, 77, 78, 80, 81, 85, 86, 88, 92, 93, 94, 95, 98, 102, 104, 105, 108, 110, 111, 116, 118, 119, 122, 123, 124, 125, 128, 130, 133, 134, 138, 140, 143, 144, 145, 146, 148
Offset: 1

Views

Author

T. D. Noe, Mar 26 2008

Keywords

Comments

Also numbers n such that all terms in row n of A087401 are not prime. Also the index of the triangular numbers in A076768. See A087572 for the least prime, if it exists. David Wasserman points out (in A087572) that n is in this sequence if and only if n and 2n-1 are both not prime. This sequence is infinite because 2k^2 is a term for all k>1.

Examples

			8 is in this sequence because 8, 15=7+8, 21=6+7+8, 26=5+6+7+8, 30=4+5+6+7+8, 33=3+4+5+6+7+8, 35=2+3+4+5+6+7+8 and 36=1+2+3+4+5+6+7+8 are all composite.
		

Crossrefs

Cf. A010051.

Programs

  • Haskell
    a138666 n = a138666_list !! (n-1)
    a138666_list = map (head . tail) $
       filter (all (== 0) . map a010051 . tail) $ drop 2 a087401_tabl
    -- Reinhard Zumkeller, Oct 03 2012
    
  • Mathematica
    Select[Range[200], !PrimeQ[ # ] && !PrimeQ[2#-1] &]
    Select[Range[150],AllTrue[Accumulate[Reverse[Range[#]]],!PrimeQ[#]&]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 18 2017 *)
  • Python
    from sympy import isprime
    from itertools import accumulate
    def ok(n): return all(not isprime(s) for s in accumulate(range(n, 0, -1)))
    def aupto(nn): return [m for m in range(1, nn+1) if ok(m)]
    print(aupto(148)) # Michael S. Branicky, Jan 08 2021

A100592 Least positive integer that can be represented as the sum of exactly two semiprimes in exactly n ways.

Original entry on oeis.org

1, 8, 18, 30, 43, 48, 60, 72, 91, 108, 132, 155, 120, 144, 192, 168, 216, 236, 227, 180, 320, 340, 240, 252, 348, 300, 324, 336, 488, 484, 456, 396, 614, 360, 524, 548, 706, 468, 536, 656, 628, 420, 624, 576, 612, 588, 540, 600, 648, 768, 732, 800, 832, 660
Offset: 0

Views

Author

Jonathan Vos Post, Nov 30 2004

Keywords

Comments

A072931(a(n)) = n and A072931(m) < n for m < a(n). [From Reinhard Zumkeller, Jan 21 2010]

Examples

			a(0) = 1 because 1 is the smallest positive integer that cannot be represented as sum of two semiprimes (since 4 is the smallest semiprime). a(1) = 8 because 8 is the smallest such sum of two semiprimes: 4 + 4. Similarly a(2) = 18 because 18 = 14 + 4 = 9 + 9 where {4,9,14} are semiprimes and there is no third such sum for 18.
		

Crossrefs

Formula

a(n) = min{i such that i = A001358(j) + A001358(k) in n ways}.

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

A101182 Least positive integer that can be represented as the sum of a prime and a triangular number in exactly n ways.

Original entry on oeis.org

1, 2, 3, 8, 17, 83, 47, 89, 107, 212, 194, 347, 284, 674, 524, 464, 467, 947, 662, 1187, 1514, 1304, 1019, 1229, 1559, 2189, 1724, 2699, 2084, 3434, 2417, 4022, 3467, 3824, 3764, 3362, 5324, 5879, 5672, 7214, 5927, 6179, 6134, 7079, 6704, 7727, 10667
Offset: 0

Views

Author

Jonathan Vos Post and Ray Chandler, Dec 14 2004

Keywords

Examples

			a(0) = 1 because 1 is the smallest positive integer that cannot be represented as sum of a prime and a triangular number (since 2 is the smallest prime).
a(1) = 2 = 2 + 0; a(2) = 3 = 3 + 0 = 2 + 1; a(3) = 8 = 2 + 6 = 5 + 3 = 7 + 1.
		

Crossrefs

Formula

a(n) = min{i such that i = A000040(j) + A000217(k) in n ways}.

A111908 Numbers that are not the sum of a prime and a nonzero triangular number.

Original entry on oeis.org

1, 2, 7, 36, 61, 105, 171, 210, 211, 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
Offset: 1

Views

Author

Stefan Steinerberger, Nov 25 2005

Keywords

Comments

Can anybody prove or disprove a(n) = O(n^c) for some constant c?
Jonathan Vos Post has observed that every term in A076768 also occurs in this sequence.

Examples

			7 = 1+6 = 2+5 = 3+4; 7 is in the sequence because there is no sum where the first element is a prime and the second one a triangular number.
		

Crossrefs

Programs

  • Mathematica
    lim=6000;plim=PrimePi[lim];tlim=Ceiling[Sqrt[2lim]];Complement[Range[lim],Union[Flatten[Table[Prime[i]+PolygonalNumber[j],{i,plim},{j,tlim}]]]] (* James C. McMahon, Jun 04 2024 *)

Extensions

a(47) and offset corrected by Donovan Johnson, Feb 09 2013

A224362 Number of partitions of n into a prime and a triangular number.

Original entry on oeis.org

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

Views

Author

Alex Ratushnyak, Apr 04 2013

Keywords

Comments

Indices of zeros: 0 followed by A076768.

Crossrefs

Programs

  • Mathematica
    nn = 13; tri = Table[n*(n + 1)/2, {n, 0, nn}]; pr = Prime[Range[PrimePi[tri[[-1]]]]]; Table[Length[Intersection[pr, n - tri]], {n, 0, tri[[-1]]}] (* T. D. Noe, Apr 05 2013 *)
  • Python
    import math
    primes = [2, 3]
    def isprime(k):
      for p in primes:
        if k%p==0:  return 0
      primes.append(k)
      return 1
    def rootTriangular(a):
        sr = 2**(int(math.log(a,2))+2)
        while a < sr*(sr+1)//2:
              sr>>=1
        b = sr>>1
        while b:
          s = sr+b
          if a >= s*(s+1)//2:
            sr = s
          b>>=1
        return sr
    for i in range(1<<10):
        k = 0
        for p in primes:
          if i <= p:  continue
          r = rootTriangular(i - p)
          if r*(r+1)//2 == i-p:  k+=1
        if i>1:
          if i<=3:  k += 1
          else:     k += isprime(i)
        print(k, end=', ')

Formula

G.f.: (Sum_{i>=0} x^(i*(i+1)/2))*(Sum_{j>=1} x^prime(j)). - Ilya Gutkovskiy, Feb 07 2017

A100591 Least positive integer that can be represented as sum of semiprime and a triangular number in exactly n ways. Triangular numbers include t(0)=0 and (1)=1.

Original entry on oeis.org

1, 4, 7, 10, 35, 25, 49, 61, 121, 140, 211, 268, 224, 392, 472, 517, 565, 529, 707, 1006, 1039, 994, 1213, 989, 1274, 1717, 1769, 1822, 2047, 2272, 2419, 2573, 2642, 3029, 3149, 3152, 3848, 3359, 4199, 4019, 4307, 4847, 5027, 4877, 5492, 6077
Offset: 0

Views

Author

Jonathan Vos Post, Nov 30 2004

Keywords

Comments

Computed by Ray Chandler.

Examples

			a(0) = 1 because 1 is the smallest positive integer that cannot be represented as sum of semiprime and a triangular number (since 4 is the smallest semiprime). a(1) = 4 because 4 is the smallest such sum, namely semiprime(1)=4 + t(0)=0. Similarly a(2) = 7 because 7 = 4 + 3 and 7 = 6 + 1, where 4 and 6 are semiprimes, 3 and 1 are triangular.
		

Crossrefs

Formula

a(n) = min(i such that i = A001358(j) + A000217(k) in n ways).

A100593 Greatest positive integer that can be represented as the sum of exactly two semiprimes in exactly n ways.

Original entry on oeis.org

33, 62, 105, 122, 135, 174, 285, 214, 294, 315, 318, 366, 525, 405, 394, 474, 498, 585, 495, 529, 765, 645, 735, 693, 945, 705, 761, 825, 1155, 1109, 901, 989, 1049, 1123, 1365, 1063, 1121, 1181, 1243, 1129, 1231, 1169, 1349, 1485, 1399, 1577
Offset: 0

Views

Author

Jonathan Vos Post, Nov 30 2004

Keywords

Examples

			a(0) = 33 is only a conjecture, based on computer searches by Lior Manor and by Ray Chandler. a(1) = 62 because 62 = 58 + 4 is the only way to partition 62 into two semiprimes.
		

Crossrefs

Formula

a(n) = max{i such that i = A001358(j) + A001358(k) in n ways}.

A255904 Numbers that are neither triangular nor the sum of a positive triangular number and a prime.

Original entry on oeis.org

2, 7, 61, 211, 216
Offset: 1

Views

Author

Arkadiusz Wesolowski, Mar 10 2015

Keywords

Comments

Probably finite.
First four terms are primes, and are in A065397.
If it exists, a(6) > 5*10^6. - Derek Orr, Mar 12 2015
If it exists, a(6) > 4*10^9. - Hiroaki Yamanouchi, Mar 16 2015

Examples

			a(2) = 7 is in the sequence because 7 is not a triangular number, and cannot be written as a sum of the primes < 7 {2, 3, 5} and one of the positive triangular numbers < 7 {1, 3, 6}.
		

Crossrefs

Programs

  • Magma
    lst:=[]; r:=21; for n in [0..r*(r+1)/2] do if not IsSquare(8*n+1) then f:=0; k:=1; while k*(k+1)/2 lt n-1 do if IsPrime(n-Truncate(k*(k+1)/2)) then f:=1; break; end if; k+:=1; end while; if IsZero(f) then Append(~lst, n); end if; end if; end for; lst;
    
  • PARI
    a(n)=k=1;while(n-(t=k*(k+1)/2)>=0,if(isprime(n-t)||n==t,return(k));k++)
    n=1;while(n<10^5,if(!a(n),print1(n,", "));n++) \\ Derek Orr, Mar 12 2015
Showing 1-10 of 10 results.