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

A086473 Numbers in A058080 having only one factor pair (both distinct from 1) that add up to a sum belonging to A014092.

Original entry on oeis.org

18, 24, 28, 50, 52, 54, 76, 92, 96, 98, 100, 112, 124, 140, 144, 148, 152, 160, 172, 176, 188, 192, 208, 212, 216, 220, 228, 232, 242, 244, 260, 266, 268, 280, 288, 290, 292, 304, 308, 316, 332, 336, 338, 344, 356, 374, 384, 388, 392, 400, 412, 434, 436, 448
Offset: 1

Views

Author

Lekraj Beedassy, Sep 09 2003

Keywords

Comments

Related to the "Impossible Problem" of Martin Gardner.

Examples

			A058080(3)=18 is in the sequence because 18=2*9=3*6 and only 2+9=11 belongs to A014092. However, A058080(7)=30 is not in the sequence because 30=2*15=3*10=5*6 with both 2+15 and 5+6 belonging to A014092.
		

References

  • M. Criton, "Le Problème Impossible", Jeux Mathématiques, Tangente Hors Série No. 20 Pole Paris 2004.

Crossrefs

Extensions

Corrected and extended by Ray Chandler, Sep 21 2003

A086533 Numbers in A014092 splittable into a sum of a single number pair (both distinct from 1) having a product that belongs to A086473.

Original entry on oeis.org

17, 65, 89, 127, 137, 163, 179, 185, 191, 233, 247, 269, 305, 343, 427, 457, 547, 569, 583, 613, 637, 667, 673, 697, 733, 757, 779, 787, 817, 821, 853, 929, 967, 977, 989, 997, 1045, 1087, 1117, 1207, 1267, 1273, 1289, 1297, 1327, 1345, 1357
Offset: 1

Views

Author

Lekraj Beedassy, Sep 10 2003

Keywords

Comments

The first term is the sum solution of Martin Gardner's "Impossible Problem" for numbers each with an upper bound anywhere between 62 and 100.

References

  • M. Gardner,"Mathematical Games" Problem 1 pp. 20, 23-24 in Scientific American, Dec. 1979.

Crossrefs

For the corresponding (unique) products see A086860.
The number pairs are given by {a(n) -+ A086888(n)}/2.

A006512 Greater of twin primes.

Original entry on oeis.org

5, 7, 13, 19, 31, 43, 61, 73, 103, 109, 139, 151, 181, 193, 199, 229, 241, 271, 283, 313, 349, 421, 433, 463, 523, 571, 601, 619, 643, 661, 811, 823, 829, 859, 883, 1021, 1033, 1051, 1063, 1093, 1153, 1231, 1279, 1291, 1303, 1321, 1429, 1453, 1483, 1489, 1609
Offset: 1

Views

Author

Keywords

Comments

Also primes that are the sum of two primes (which is possible only if 2 is one of the primes). - Cino Hilliard, Jul 02 2004, edited by M. F. Hasler, Nov 14 2019
The set of greater of twin primes larger than five is a proper subset of the set of primes of the form 3n + 1 (A002476). - Paul Muljadi, Jun 05 2008
Smallest prime > n-th isolated composite. - Juri-Stepan Gerasimov, Nov 07 2009
Subsequence of A175075. Union of a(n) and sequence A175080 is A175075. - Jaroslav Krizek, Jan 30 2010
A164292(a(n))=1; A010051(a(n)+2)=0 for n > 1. - Reinhard Zumkeller, Mar 29 2010
Omega(n) = Omega(n-2); d(n) = d(n-2). - Juri-Stepan Gerasimov, Sep 19 2010
Aside from the first term, all subsequent terms have digital root 1, 4, or 7. - J. W. Helkenberg, Jul 24 2013
Also primes p with property that the sum of the successive gaps between primes <= p is a prime number. - Robert G. Wilson v, Dec 19 2014
The phrase "x is an element of the {primes, positive integers} and there {exist no, exist} elements a,b of {1 and primes, primes}: a+b=x" determines A133410, A067829, A025584, A006512, A166081, A014092, A014091 and A038609 for the first few hundred terms with only de-duplication or omitting/including 3, 4 and 6 in the case of A166081/A014091 and one case of omitting/including 3 given 1 isn't prime. - Harry G. Coin, Nov 25 2015
The yet unproved Twin Prime Conjecture states that this sequence is infinite. - M. F. Hasler, Nov 14 2019

References

  • See A001359 for further references and links.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of A139690.
Bisection of A077800.

Programs

  • Haskell
    a006512 = (+ 2) . a001359 -- Reinhard Zumkeller, Feb 10 2015
    
  • Magma
    [n: n in PrimesUpTo(1610)|IsPrime(n-2)]; // Bruno Berselli, Feb 28 2011
    
  • Maple
    for i from 1 to 253 do if ithprime(i+1) = ithprime(i) + 2 then print({ithprime(i+1)}); fi; od; # Zerinvary Lajos, Mar 19 2007
    P := select(isprime,[$1..1609]): select(p->member(p-2,P),P); # Peter Luschny, Mar 03 2011
    A006512 := proc(n)
        2+A001359(n) ;
    end proc: # R. J. Mathar, Nov 26 2014
  • Mathematica
    Select[Prime[Range[254]], PrimeQ[# - 2] &] (* Robert G. Wilson v, Jun 09 2005 *)
    Transpose[Select[Partition[Prime[Range[300]], 2, 1], Last[#] - First[#] == 2 &]][[2]] (* Harvey P. Dale, Nov 02 2011 *)
    Cases[Prime[Range[500]] + 2, ?PrimeQ] (* _Fred Patrick Doty, Aug 23 2017 *)
  • PARI
    select(p->isprime(p-2),primes(1000))
    
  • PARI
    a(n)=p=3; while(p+2 < (p=nextprime(p+1)) || n-->0, ); p
    vector(100, n, a(n)) \\ Altug Alkan, Dec 04 2015
    
  • Python
    from sympy import primerange, isprime
    print([n for n in primerange(1, 2001) if isprime(n - 2)]) # Indranil Ghosh, Jul 20 2017

A061358 Number of ways of writing n = p+q with p, q primes and p >= q.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Apr 28 2001

Keywords

Comments

For an odd number n, a(n) = 0 if n-2 is not a prime, otherwise a(n) = 1.
For n > 1, a(2n) is at least 1, according to Goldbach's conjecture.
a(A014092(n)) = 0; a(A014091(n)) > 0; a(A067187(n)) = 1. - Reinhard Zumkeller, Nov 22 2004
Number of partitions of n into two primes.
Number of unordered ways of writing n as the sum of two primes.
a(2*n) = A068307(2*n+2). - Reinhard Zumkeller, Aug 08 2009
4*a(n) is the total number of divisors of all primes p and q such that n = p+q and p >= q. - Wesley Ivan Hurt, Mar 05 2016
Indices where a(n) = 0 correspond to A164376 UNION A025584. - Bill McEachen, Jan 31 2024

Examples

			a(22) = 3 because 22 can be written as 3+19, 5+17 and 11+11.
		

Crossrefs

Programs

  • Magma
    [#RestrictedPartitions(n,2,{p:p in PrimesUpTo(1000)}):n in [0..100] ] // Marius A. Burtea, Jan 19 2019
  • Maple
    g:=sum(sum(x^(ithprime(i)+ithprime(j)),i=1..j),j=1..30): gser:=series(g,x=0,110): seq(coeff(gser,x,n),n=0..105); # Emeric Deutsch, Apr 03 2006
  • Mathematica
    a[n_] := Length[Select[n - Prime[Range[PrimePi[n/2]]], PrimeQ]]; Table[a[n], {n, 0, 100}] (* Paul Abbott, Jan 11 2005 *)
    With[{nn=110},CoefficientList[Series[Sum[x^(Prime[i]+Prime[j]),{j,nn},{i,j}],{x,0,nn}],x]] (* Harvey P. Dale, Aug 17 2017 *)
    Table[Count[IntegerPartitions[n,{2}],?(AllTrue[#,PrimeQ]&)],{n,0,110}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale, Jul 03 2021 *)
  • PARI
    a(n)=my(s);forprime(q=2,n\2,s+=isprime(n-q));s \\ Charles R Greathouse IV, Mar 21 2013
    
  • Python
    from sympy import primerange, isprime, floor
    def a(n):
        s=0
        for q in primerange(2, n//2 + 1): s+=isprime(n - q)
        return s
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 30 2017
    

Formula

G.f.: Sum_{j>0} Sum_{i=1..j} x^(p(i)+p(j)), where p(k) is the k-th prime. - Emeric Deutsch, Apr 03 2006
A065577(n) = a(10^n).
From Wesley Ivan Hurt, Jan 04 2013: (Start)
a(n) = Sum_{i=1..floor(n/2)} A010051(i) * A010051(n-i).
a(n) = Sum_{i=1..floor(n/2)} floor((A010051(i) + A010051(n-i))/2). (End)
a(n) + A062610(n) + A062602(n) = A004526(n). - R. J. Mathar, Sep 10 2021
a(n) = Sum_{k=floor((n-1)^2/4)+1..floor(n^2/4)} c(A339399(2k-1)) * c(A339399(2k)), where c = A010051. - Wesley Ivan Hurt, Jan 19 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 15 2001
Comments edited by Zak Seidov, May 28 2014

A002372 Goldbach conjecture: number of decompositions of 2n into ordered sums of two odd primes.

Original entry on oeis.org

0, 0, 1, 2, 3, 2, 3, 4, 4, 4, 5, 6, 5, 4, 6, 4, 7, 8, 3, 6, 8, 6, 7, 10, 8, 6, 10, 6, 7, 12, 5, 10, 12, 4, 10, 12, 9, 10, 14, 8, 9, 16, 9, 8, 18, 8, 9, 14, 6, 12, 16, 10, 11, 16, 12, 14, 20, 12, 11, 24, 7, 10, 20, 6, 14, 18, 11, 10, 16, 14, 15, 22, 11, 10, 24, 8, 16, 22, 9, 16, 20, 10
Offset: 1

Views

Author

Keywords

Comments

The weak form of this conjecture was proved by Helfgott (see link below). - T. D. Noe, May 14 2013
Goldbach conjectured in 1742 that for n >= 3, this sequence never vanishes. This is still unproved.
Number of different primes occurring when 2n is expressed as p1+q1 = ... = pk+qk where pk,qk are odd primes with pk <= qk. For example when n=5: 10 = 3+7 = 5+5, we can see 3 different primes so a(5) = 3. - Naohiro Nomoto, Feb 24 2002
Comments from Tomás Oliveira e Silva to Number Theory List, Feb 05 2005: With the help of Siegfied "Zig" Herzog of PSU, I was able to verify the Goldbach conjecture up to 2e17. Let 2n=p+q, with p and q prime be a Goldbach partition of 2n. In a minimal Goldbach partition p is as small as possible. The largest p of a minimal Goldbach partition found was 8443 and is needed for 2n=121005022304007026. Furthermore, the largest prime gap found was 1220-1; it occurs after the prime 80873624627234849.
Comments from Tomás Oliveira e Silva to Number Theory List, Apr 26 2007: With the help of Siegfried "Zig" Herzog, the NCSA and others, I have just finished the verification of the Goldbach conjecture up to 1e18. This took about 320 years of CPU time, including a double-check of the results up to 1e17. As expected, no counterexample to the conjecture was found. As side results, the number of twin primes up to 1e18 was also computed, as was the number of primes in each of the residue classes modulo 120. Also, the number of occurrences of each (observed) prime gap was also recorded.
For n > 2 we have a(n) = 2*A002375(n)-1 if n is prime and a(n) = 2*A002375(n) if n is composite. - Emeric Deutsch, Jul 14 2004
For n > 2, a(n) = 2*A002375(n) - A010051(n). - Jason Kimberley, Aug 31 2011
a(n) = Sum_{p odd prime < 2*n} A010051(2*n - p). - Reinhard Zumkeller, Oct 19 2011
There is an interesting similarity with square numbers: The number of divisors of n is odd iff n is square (A000290). The number of decompositions of 2n into ordered sums of two primes (equaling the number of the unique primes in all such decompositions) is odd iff n is prime. - Ivan N. Ianakiev, Feb 28 2015

Examples

			2 has no such decompositions, so a(1) = 0.
Idem for 4, whence a(2) = 0.
6 = 3+3, so a(3) = 1.
8 = 3+5 = 5+3, so a(4) = 2.
10 = 5+5 = 3+7 = 7+3, so a(5) = 3.
12 = 5+7 = 7+5; so a(6) = 2, etc.
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 9.
  • R. K. Guy, Unsolved problems in number theory, second edition, Springer-Verlag, 1994.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Section 2.8 (for Goldbach conjecture).
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, pp. 79, 80.
  • N. Pipping, Neue Tafeln für das Goldbachsche Gesetz nebst Berichtigungen zu den Haussnerschen Tafeln, Finska Vetenskaps-Societeten, Comment. Physico Math. 4 (No. 4, 1927), pp. 1-27.
  • 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).
  • M. L. Stein and P. R. Stein, Tables of the Number of Binary Decompositions of All Even Numbers Less Than 200,000 into Prime Numbers and Lucky Numbers. Report LA-3106, Los Alamos Scientific Laboratory of the University of California, Los Alamos, NM, Sep 1964.

Crossrefs

Essentially identical to A035026.

Programs

  • Haskell
    a002372 n = sum $ map (a010051 . (2*n -)) $ takeWhile (< 2*n) a065091_list
    -- Reinhard Zumkeller, Oct 19 2011
    
  • Magma
    A002372 := func; [A002372(n):n in[1..82]]; // Jason Kimberley, Sep 01 2011
    
  • Maple
    a:=proc(n) local c,k; c:=0: for k from 1 to n do if isprime(2*k+1)=true and isprime(2*n-2*k-1)=true then c:=c+1 else c:=c fi od end: seq(a(n),n=1..82); # Emeric Deutsch, Jul 14 2004
  • Mathematica
    For[lst={}; n=1, n<=100, n++, For[cnt=0; i=1, i<=2n-1, i++ If[OddQ[i]&&PrimeQ[i]&&PrimeQ[2n-i], cnt++ ]]; AppendTo[lst, cnt]]; lst
    (* second program: *)
    A002372[n_] := Module[{i = 0}, Do[If[PrimeQ[2 n - Prime@p], i++], {p, 2, PrimePi[2 n - 3]}]; i]; Array[A002372, 82] (* JungHwan Min, Aug 24 2016 *)
    i[n_] := If[PrimeQ[2 n - 1], 2 n - 1, 0]; A085090 = Array[i, 82];
    r[n_] := Table[A085090[[k]] + A085090[[n - k + 1]], {k, 1, n}];
    countzeros[l_List] := Sum[KroneckerDelta[0, k], {k, l}];
    Table[n - 2 countzeros[A085090[[1 ;; n]]] + countzeros[r[n]],
    {n, 1, 82}] (* Fred Daniel Kline, Aug 13 2018 *)
    countPrimes[n_] := Sum[KroneckerDelta[True, PrimeQ[2 m - 1],
    PrimeQ[2 (n - m + 1) - 1]], {m, 1, n}]; Array[countPrimes, 82] (* Fred Daniel Kline, Oct 07 2018 *)
  • PARI
    isop(n) = (n % 2) && isprime(n);
    a(n) = n*=2; sum(i=1, n-1, isop(i)*isop(n-i)); \\ Michel Marcus, Aug 22 2014 and May 28 2020
    
  • Python
    from sympy import isprime, primerange
    def a(n): return sum([1 for p in primerange(3, 2*n-2) if isprime(2*n-p)])
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Apr 23 2017

Formula

a(n) = A010051(n) + 2*A061357(n), n > 2. - R. J. Mathar, Aug 19 2013

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jun 13 2002
Edited by M. F. Hasler, May 03 2019

A025584 Primes p such that p-2 is not a prime.

Original entry on oeis.org

2, 3, 11, 17, 23, 29, 37, 41, 47, 53, 59, 67, 71, 79, 83, 89, 97, 101, 107, 113, 127, 131, 137, 149, 157, 163, 167, 173, 179, 191, 197, 211, 223, 227, 233, 239, 251, 257, 263, 269, 277, 281, 293, 307, 311, 317, 331, 337, 347, 353, 359, 367, 373, 379, 383, 389, 397, 401
Offset: 1

Views

Author

Keywords

Comments

Primes p (for p>=11) such that sigma(p-2) > p. - Benoit Cloitre, Feb 08 2002
Prime numbers that are not the sum of two smaller prime numbers. - Tomas Xordan, May 10 2007

Crossrefs

Complement of A006512 in A000040.
Cf. A014092.

Programs

  • Magma
    [p: p in PrimesUpTo(420) | not IsPrime(p-2)]; // Vincenzo Librandi, Jul 26 2013
    
  • Mathematica
    Select[ Prime /@ Range[100], ! PrimeQ[# - 2] &] (* Jean-François Alcover, Apr 19 2013 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if (!isprime(p-2), print1(p, ", "));); \\ Michel Marcus, Dec 05 2015

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Jan 10 2013

Extensions

Better description from Vladeta Jovovic, Dec 14 2002

A002373 Smallest prime in decomposition of 2n into sum of two odd primes.

Original entry on oeis.org

3, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 5, 7, 3, 3, 5, 7, 3, 5, 3, 3, 5, 3, 5, 7, 3, 5, 7, 3, 3, 5, 7, 3, 5, 3, 3, 5, 7, 3, 5, 3, 5, 7, 3, 5, 7, 19, 3, 5, 3, 3, 5, 3, 3, 5, 3, 5, 7, 13, 11, 13, 19, 3, 5, 3, 5, 7, 3, 3, 5, 7, 11, 11, 3, 3, 5, 7, 3, 5, 7, 3, 5, 3, 5, 7, 3, 5, 7, 3, 3, 5, 7, 11, 11, 3, 3, 5, 3
Offset: 3

Views

Author

Keywords

Comments

See A020481 for another version.
a(A208662(n)) = A065091(n) and a(m) <> A065091(n) for m < A208662(n). - Reinhard Zumkeller, Feb 29 2012
Records are in A025019, their indices in A051610. - Ralf Stephan, Dec 29 2013
Note that these primes do not all belong to a twin prime pair. The first instance is a(110) = 23. - Michel Marcus, Aug 17 2020 from a suggestion by Pierre CAMI

References

  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 80.
  • N. Pipping, Neue Tafeln für das Goldbachsche Gesetz nebst Berichtigungen zu den Haussnerschen Tafeln, Finska Vetenskaps-Societeten, Comment. Physico Math. 4 (No. 4, 1927), pp. 1-27.
  • 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

Programs

  • Haskell
    a002373 n = head $ dropWhile ((== 0) . a010051 . (2*n -)) a065091_list -- Reinhard Zumkeller, Feb 29 2012
    
  • Mathematica
    Table[k = 2; While[q = Prime[k]; ! PrimeQ[2*n - q], k++]; q, {n, 3, 100}] (* Jean-François Alcover, Apr 26 2011 *)
    Table[Min[Flatten[Select[IntegerPartitions[2*n,{2}],AllTrue[ #,OddQ] && AllTrue[#,PrimeQ]&]]],{n,3,100}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 31 2020 *)
  • PARI
    a(n)=forprime(p=3,n,if(isprime(2*n-p), return(p))) \\ Charles R Greathouse IV, May 18 2015

Extensions

More terms from Ray Chandler, Sep 19 2003

A014091 Numbers that are the sum of 2 primes.

Original entry on oeis.org

4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 24, 25, 26, 28, 30, 31, 32, 33, 34, 36, 38, 39, 40, 42, 43, 44, 45, 46, 48, 49, 50, 52, 54, 55, 56, 58, 60, 61, 62, 63, 64, 66, 68, 69, 70, 72, 73, 74, 75, 76, 78, 80, 81, 82, 84, 85, 86, 88, 90, 91, 92, 94, 96, 98
Offset: 1

Views

Author

Keywords

Comments

Sequence consists of all primes + 2 and, conjecturally (Goldbach), of all even integers larger than 2. The Goldbach conjecture is that every even number is the sum of two primes. - Emeric Deutsch, Jul 14 2004

Crossrefs

Complement = A014092.
Cf. A010051, A000040, A157931 (semiprimes).

Programs

  • Haskell
    a014091 n = a014091_list !! (n-1)
    a014091_list = filter (\x -> any ((== 1) . a010051) $
                          map (x -) $ takeWhile (< x) a000040_list) [1..]
    -- Reinhard Zumkeller, Oct 15 2014
  • Maple
    sort({seq(2+ithprime(j),j=1..21)} union {seq(2*k,k=2..ceil(ithprime(21)/2))}); # Emeric Deutsch, Jul 14 2004
  • Mathematica
    Take[ Union@ Flatten@ Table[ Prime@p + Prime@q, {p, 25}, {q, p}], 71] (* Robert G. Wilson v, Aug 31 2008 *)
  • PARI
    isA014091(n)= my(i,p); i=1; p=prime(i); while(pA014091(a), print(n," ",a); n++)) \\ R. J. Mathar, Aug 20 2006
    
  • PARI
    is(n)=if(n%2,isprime(n-2),n>2) \\ on Goldbach's conjecture; Charles R Greathouse IV, Oct 22 2013
    

Extensions

More terms from Robert G. Wilson v, Aug 31 2008

A035137 Numbers that are not the sum of 2 palindromes (where 0 is considered a palindrome).

Original entry on oeis.org

21, 32, 43, 54, 65, 76, 87, 98, 201, 1031, 1041, 1042, 1051, 1052, 1053, 1061, 1062, 1063, 1064, 1071, 1072, 1073, 1074, 1075, 1081, 1082, 1083, 1084, 1085, 1086, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1099, 1101, 1103, 1104, 1105, 1106, 1107, 1108
Offset: 1

Views

Author

Patrick De Geest, Nov 15 1998

Keywords

Comments

Apparently, every positive number is equal to the sum of at most 3 positive palindromes. - Giovanni Resta, May 12 2013
A260254(a(n)) = 0. - Reinhard Zumkeller, Jul 21 2015
A261675(a(n)) >= 3 (and, conjecturally, = 3). - N. J. A. Sloane, Sep 03 2015
This sequence is infinite. Proof: It is easy to see that 200...01 (with any number of zeros) cannot be the sum of two palindromes. - N. J. A. Sloane, Sep 03 2015
The conjecture that every number is the sum of 3 palindromes fails iff there is a term a(n) such that for all palindromes P < a(n), the difference a(n) - P is also a term of this sequence. - M. F. Hasler, Sep 08 2015
Cilleruelo and Luca (see links) have proved the conjecture that every positive integer is the sum of at most three palindromes (in bases >= 5), and also that the density of those that require three is positive. - Christopher E. Thompson, Apr 14 2016

Crossrefs

Cf. A260254, A260255 (complement), A002113, A261906, A261907.
Cf. A319477 (disallowing zero).

Programs

  • Haskell
    a035137 n = a035137_list !! (n-1)
    a035137_list = filter ((== 0) . a260254) [0..]
    -- Reinhard Zumkeller, Jul 21 2015
    
  • Maple
    N:= 4: # to get all terms with <= N digits
    revdigs:= proc(n) local L,j,nL;
      L:= convert(n,base,10); nL:= nops(L);
      add(L[j]*10^(nL-j),j=1..nL);
    end proc;
    palis:= $0..9:
    for d from 2 to N do
      if d::even then
        palis:= palis, seq(x*10^(d/2)+revdigs(x),x=10^(d/2-1)..10^(d/2)-1)
      else
        palis:= palis, seq(seq(x*10^((d+1)/2)+y*10^((d-1)/2)+revdigs(x),y=0..9),x=10^((d-3)/2)..10^((d-1)/2)-1);
      fi
    od:
    palis:= [palis]:
    A:= Array(0..10^N-1):
    A[palis]:= 1:
    B:= SignalProcessing:-Convolution(A,A):
    select(t -> B[t+1] < 0.5, [$1..10^N-1]); # Robert Israel, Jun 22 2015
  • Mathematica
    palQ[n_]:=FromDigits[Reverse[IntegerDigits[n]]]==n; nn=1108; t={}; Do[i=c=0; While[i<=n && c!=1,If[palQ[i] && palQ[n-i], AppendTo[t,n]; c=1]; i++],{n,nn}]; Complement[Range[nn],t] (* Jayanta Basu, May 12 2013 *)
  • PARI
    is_A035137(n)={my(k=0);!until(n<2*k=nxt(k),is_A002113(n-k)&&return)} \\ Uses function nxt() given in A002113. Not very efficient for large n, better start with k=n-A261423(n). Maybe also better use A261423 rather than nxt(). - M. F. Hasler, Jul 21 2015

A062610 Number of ways of writing n = c1 + c2 with c1 and c2 nonprimes [=1 or composite].

Original entry on oeis.org

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

Views

Author

Labos Elemer, Jul 04 2001

Keywords

Examples

			n = 22 has floor(n/2) = 11 partitions of form n = a+b; 3 partitions are of prime+prime [3+19 = 5+17 = 11+11], 3 partitions are of prime+nonprime [2+20 = 7+15 = 13+9], 5 partitions are of nonprime+nonprime [1+21 = 4+18 = 6+16 = 8+14 = 10+12]. So a(22) = 5.
		

Crossrefs

Programs

  • Mathematica
    Table[Count[Transpose@ {#, n - #} &@ Range[Floor[n/2]], w_ /; Times @@ Boole@ Map[! PrimeQ@ # &, w] == 1], {n, 83}] (* Michael De Vlieger, Jul 04 2016 *)

Formula

a(n) = Sum_{i=1..floor(n/2)} (1 - A010051(i)) * (1 - A010051(n-i)) = Sum_{i=1..floor(n/2)} A005171(i)*A005171(n-i). - Wesley Ivan Hurt, Apr 08 2018
a(n) + A061358(n) + A062602(n) = A004526(n). - R. J. Mathar, Sep 10 2021
Showing 1-10 of 48 results. Next