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

A175931 Numbers n such that A129363(n-1) = A129363(n) = A129363(n+1).

Original entry on oeis.org

8, 9, 48, 54, 198, 201, 258, 348, 393, 453, 558, 573, 633, 678, 1623, 2103
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 23 2010

Keywords

Comments

A129363(n) is the number of partitions of 2*n into the sum of two twin primes.
Conjecture: Sequence is finite and complete with last term 2103.
No further term between 2103 and 26000 - [From R. J. Mathar, Oct 24 2010]

Examples

			A129363(8) = A129363(9) = A129363(10) = 2 (the partitions are 16 = 3+13 = 5+11, 18 = 5+13 = 7+11, 20 = 3+17 = 7+13), hence 9 is in the sequence.
A129363(197) = A129363(198) = A129363(199) = 1 (the partitions are 394 = 197+197, 396 = 197+199, 398 = 199+199), hence 198 is in the sequence.
A129363(47) = A129363(48) = A129363(49) = 0 (there are no partitions of 94, 96, 98), hence 48 is in the sequence.
		

Crossrefs

Cf. A129363, A001097 (twin primes).

Extensions

Corrected (term 1 removed) and edited by Klaus Brockhaus, Oct 28 2010

A376287 Index of first occurrence of n in A129363, or 0 if no such number exists.

Original entry on oeis.org

2, 6, 10, 22, 48, 120, 114, 298, 240, 540, 288, 1620, 210, 300, 702, 840, 660, 2312, 1290, 4284, 1332, 2580, 2070, 2100, 1890, 5100, 2340, 5580, 3720, 6660, 3612, 6240, 2310, 10288, 3540, 4680, 4788, 5460, 4410, 5940, 6120, 10200, 4200, 4620, 3570, 10560, 5700, 16588, 5250
Offset: 0

Views

Author

Robert G. Wilson v, Sep 19 2024

Keywords

Comments

Twin prime analogous to A023036.
Conjecture: a(n) > 0. Checked to 1010.
Conjectured last occurrence: 4208, 24536, 28916, 21278, 51806, 68078, 73538, 89216, 83978, ..., .
Conjecture number of terms for A129363(k) = n: 35, 115, 285, 327, 557, 537, 723, 652, 882, ..., .
A129363(n) = 0: A007534.

Crossrefs

Programs

  • Mathematica
    tp = Select[Prime@Range@ 16340, PrimeQ[# -2] || PrimeQ[# +2] &]; f[n_] := Length@ IntegerPartitions[n, {2, 2}, tp]; t[_] := 0; k = 2; While[k < 10201, a = f@k; If[ t[a] == 0, t[a] = k]; k += 2]; t /@ Range[0, 75]

A007534 Positive even numbers that are not the sum of a pair of twin primes.

Original entry on oeis.org

2, 4, 94, 96, 98, 400, 402, 404, 514, 516, 518, 784, 786, 788, 904, 906, 908, 1114, 1116, 1118, 1144, 1146, 1148, 1264, 1266, 1268, 1354, 1356, 1358, 3244, 3246, 3248, 4204, 4206, 4208
Offset: 1

Views

Author

Keywords

Comments

Conjectured to be complete (although if this were proved it would prove the "twin primes conjecture"!).
No other n < 10^9. - T. D. Noe, Apr 10 2007
Of these 35, the only 5 which are two times a prime (or in A001747) are 4 = 2 * 2, 94 = 2 * 47, 514 = 2 * 257, 1114 = 2 * 557, 1354 = 2 * 677. - Jonathan Vos Post, Mar 06 2010

Examples

			The twin primes < 100 are 3, 5, 7, 11, 13, 17, 19, 29, 31, 41, 43, 59, 61, 71, 73. 94 is in the sequence because no combination of any two numbers from the set just enumerated can be summed to make 94.
		

References

  • Harvey Dubner, Twin Prime Conjectures, Journal of Recreational Mathematics, Vol. 30 (3), 1999-2000.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • D. Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, 132.

Crossrefs

Cf. A051345, A179825, A129363 (number of partitions of 2n into the sum of two twin primes).
A064409 is a different sequence with a superficially similar definition.

Programs

  • Haskell
    import qualified Data.Set as Set (map, null)
    import Data.Set (empty, insert, intersection)
    a007534 n = a007534_list !! (n-1)
    a007534_list = f [2,4..] empty 1 a001097_list where
       f xs'@(x:xs) s m ps'@(p:ps)
         | x > m = f xs' (insert p s) p ps
         | Set.null (s `intersection` Set.map (x -) s) = x : f xs s m ps'
         | otherwise = f xs s m ps'
    -- Reinhard Zumkeller, Nov 27 2011
  • Mathematica
    p = Select[ Range[ 4250 ], PrimeQ[ # ] && PrimeQ[ # + 2 ] & ]; q = Union[ Join[ p, p + 2 ] ]; Complement[ Table[ n, {n, 2, 4250, 2} ], Union[ Flatten[ Table[ q[ [ i ] ] + q[ [ j ] ], {i, 1, 223}, {j, 1, 223} ] ] ] ]
    Complement[Range[2,4220,2],Union[Total/@Tuples[Union[Flatten[ Select[ Partition[ Prime[ Range[500]],2,1],#[[2]]-#[[1]]==2&]]],2]]] (* Harvey P. Dale, Oct 09 2013 *)

A071681 Number of ways to represent the n-th prime as arithmetic mean of two other primes.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, May 31 2002

Keywords

Comments

Conjecture: a(n)>0 for n>2.
a(A137700(n))=n and a(m)<>n for m < A137700(n), A000040(A137700(n))=A126204(n). - Reinhard Zumkeller, Feb 07 2008
The conjecture follows from a slightly strengthened version of Goldbach's conjecture: that every even number > 6 is the sum of two distinct primes. - T. D. Noe, Jan 10 2011 [Corrected by Barry Cherkas and Robert Israel, May 21 2015]
a(n) = A116619(n) + 1. - Reinhard Zumkeller, Mar 27 2015
Number of primes q < prime(n), such that 2*prime(n) - q is prime. - Dmitry Kamenetsky, May 27 2023

Examples

			a(7)=3 as prime(7) = 17 = (3+31)/2 = (5+29)/2 = (11+23)/2 and 2*17-p is not prime for the other primes p < 17: {2,7,13}.
		

Crossrefs

Programs

  • Haskell
    a071681 n = sum $ map a010051' $
       takeWhile (> 0) $ map (2 * a000040 n -) $ drop n a000040_list
    -- Reinhard Zumkeller, Mar 27 2015
  • Mathematica
    f[n_] := Block[{c = 0, k = PrimePi@n - 1}, While[k > 0, If[ PrimeQ[2n - Prime@k], c++ ]; k-- ]; c]; Table[ f@ Prime@n, {n, 84}] (* Robert G. Wilson v, Mar 22 2007 *)
  • PARI
    A071681(n)={s=2*prime(n);a=0;for(i=1,n-1,a=a+isprime(s-prime(i)));a}
    

A175933 Number of ways of writing n=p+k with p a prime number and k a primorial number.

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, 0, 0, 0, 1, 1, 1, 2, 2, 0, 2, 0, 2, 1, 1, 0, 1, 1, 3, 1, 1, 0, 2, 1, 3, 0, 0, 0, 2, 1, 1, 0, 0, 0, 2, 1, 2, 1, 1, 0, 1, 0, 2, 1, 1, 0, 1, 1, 3, 1, 1, 0, 2, 0, 1, 1, 1, 0, 1, 1, 2, 0, 0, 0, 2, 1, 2, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 3, 1, 1
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 24 2010

Keywords

Comments

Number of partitions of n into the sum of a prime number and a primorial number. Number of decompositions of n into an unordered sum of a prime number and a primorial number.
For n through small powers of 10, the range of partition values seen is about log_10(n)+2. - Bill McEachen, Jan 07 2016

Examples

			a(4)=2 because 4(natural) = 2(prime)+2(primorial) = 3(prime)+1(primorial).
		

Crossrefs

Programs

  • Maple
    A002110 := proc(n) option remember; if n = 0 then 1; else mul( ithprime(k),k=1..n) ; end if; end proc:
    A175933 := proc(n) a := 0 ; for k from 0 do p := A002110(k) ; if p +2 > n then return a; elif isprime(n-p) then a := a+1 ; end if; end do: end proc:
    seq(A175933(n),n=1..120) ; # R. J. Mathar, Oct 25 2010
  • Mathematica
    t = Table[Product[Prime@ k, {k, n}], {n, 0, 5}]; Table[Count[Map[First, Function[k, Transpose@ {k - #, #} &@ Prime@ Range@ PrimePi@ k]@ n], x_ /; MemberQ[t, x]], {n, 120}]  (* Michael De Vlieger, Jan 09 2016 *)
  • PARI
    lyst(maxx)={n=1; while (n<=maxx,c=0; q=1; for(i5=0, n, if(i5>0, q=q*prime(i5)); if(q>n-2,break); z=truncate(q); if(isprime(n-z),c++)); print1(c,","); n+=1);} \\ Bill McEachen, Jan 07 2016
    
  • PARI
    A175933(n,p=1,k=1,c=0)={until(2>n-k*=p=nextprime(p+1),isprime(n-k)&&c++);c} \\ M. F. Hasler, Jan 21 2016

Extensions

a(85), a(89), etc. corrected by R. J. Mathar, Oct 25 2010

A178670 Number of ways to express prime(n) as (prime(n+k) + prime(n-k))/2.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Jan 04 2011

Keywords

Examples

			a(5) = 2 because the 5th prime (11) is half the sum of the 7th and 3rd prime (17+5) or half the sum of the 8th and 2nd prime (19+3).
a(8) = 0 because the 8th prime (19) cannot be expressed as (1/2)*(prime(8+k) + prime(8-k)) for any k.
		

Crossrefs

Programs

  • Mathematica
    nn=1000; p=Prime[Range[2*nn]]; Table[s=Take[p,n-1] + Reverse[Take[p, {n+1,2n-1}]]; Count[s,2*p[[n]]], {n,nn}]
  • PARI
    a(n)={s=2*prime(n);a=0;for(i=1,n-1,if(prime(n+i)+prime(n-i)==s,a=a+1));a}

A283875 Number of partitions of n into twin primes (A001097).

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 7, 7, 9, 9, 11, 12, 13, 15, 16, 19, 20, 23, 25, 27, 31, 33, 37, 40, 44, 49, 52, 59, 63, 69, 76, 81, 90, 96, 106, 114, 123, 135, 144, 157, 169, 183, 197, 212, 230, 246, 266, 286, 307, 330, 353, 381, 406, 436, 468, 499, 536, 572, 613, 654, 698, 746, 795, 849, 904, 964
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 17 2017

Keywords

Comments

Conjecture: every number > 7 is the sum of at most 4 twin primes (automatically implies the truth of the first version of the twin prime conjecture). For example: 8 = 5 + 3; 9 = 3 + 3 + 3; 10 = 5 + 5; 11 = 5 + 3 + 3; 12 = 7 + 5, etc.

Examples

			a(16) = 4 because we have [13, 3], [11, 5], [7, 3, 3, 3] and [5, 5, 3, 3].
		

Crossrefs

Programs

  • Mathematica
    nmax = 79; CoefficientList[Series[Product[1/(1 - Boole[PrimeQ[k] && (PrimeQ[k - 2] || PrimeQ[k + 2])] x^k), {k, 1, nmax}], {x, 0, nmax}], x]
  • PARI
    Vec(prod(k=1, 79, 1/(1 - (isprime(k) && (isprime(k - 2) || isprime(k + 2)))*x^k)) + O(x^80)) \\ Indranil Ghosh, Mar 17 2017

Formula

G.f.: Product_{k>=1} 1/(1 - x^A001097(k)).

A283876 Number of partitions of n into distinct twin primes (A001097).

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 4, 2, 4, 4, 3, 4, 4, 5, 4, 4, 5, 5, 5, 5, 6, 6, 5, 7, 6, 8, 7, 7, 9, 7, 9, 8, 9, 9, 9, 9, 11, 11, 11, 12, 11, 14, 12, 13, 14, 14, 13, 15, 15, 17, 16, 16, 19, 17, 20, 19, 21, 21, 21, 21, 23, 23, 23, 23, 24, 26, 25, 28, 28, 30, 29, 30, 32
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 17 2017

Keywords

Examples

			a(29) = 4 because we have [29], [19, 7, 3], [17, 7, 5] and [13, 11, 5].
		

Crossrefs

Programs

  • Mathematica
    nmax = 95; CoefficientList[Series[Product[1 + Boole[PrimeQ[k] && (PrimeQ[k - 2] || PrimeQ[k + 2])] x^k, {k, 1, nmax}], {x, 0, nmax}], x]
  • PARI
    listA001097(lim)=my(v=List([3]),p=5); forprime(q=7,lim, if(q-p==2, listput(v,p); listput(v,q)); p=q); if(p+2>lim && isprime(p+2), listput(v,p)); Vec(v)
    first(n)=my(v=listA001097(n),x=O('x^(n+1))+'x); Vec(prod(i=1,#v, 1+x^v[i]))[1..n+1] \\ Charles R Greathouse IV, Mar 17 2017
    
  • PARI
    Vec(prod(k=1, 95, (1 + (isprime(k) && (isprime(k - 2) || isprime(k + 2)))*x^k)) + O(x^96)) \\ Indranil Ghosh, Mar 17 2017

Formula

G.f.: Product_{k>=1} (1 + x^A001097(k)).

A212888 Conjectured number of positive even numbers that can be represented as the sum of two twin primes p + q in exactly n ways, with p >= q.

Original entry on oeis.org

35, 115, 285, 327, 557, 537, 723, 652, 882, 773, 1061, 916, 1158, 1069, 1369, 1143, 1436, 1307, 1566, 1318, 1711, 1336, 1752, 1380, 1798, 1480, 1847, 1449, 2012, 1556, 1967, 1599, 2184, 1646, 2257, 1656, 2278, 1779, 2376, 1786, 2353, 1823, 2523, 1832, 2415
Offset: 0

Views

Author

Michael Jones, May 29 2012

Keywords

Comments

For even n, a(n) - a(n-1) increases as n increases.

Crossrefs

Cf. A001097 (twin primes).
Cf. A007534 (35 numbers that have no representation).
Cf. A129363 (number of partitions of 2n into the sum of two twin primes).
Cf. A212613 (last number having n representations).

Programs

  • Mathematica
    p = Prime[Range[10000]]; tp = Select[p, PrimeQ[# + 2] || PrimeQ[# - 2] &]; {tn, t} = Transpose[Sort[Tally[Select[Flatten[Table[If[a >= b, a + b, 0], {a, tp}, {b, tp}]], # < tp[[-1]] &]]]]; Join[{Length[Complement[Range[2, tn[[-1]], 2], tn]]}, Table[Count[t, n], {n, 8}]] (* T. D. Noe, May 30 2012 *)

Extensions

Extended and corrected by T. D. Noe, May 30 2012

A299196 Number of partitions of n into distinct parts that are lesser of twin primes (A001359).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Feb 04 2018

Keywords

Comments

For n > 0 let b(n) be the inverse Euler transform of a(n). It appears that, if p is the lesser of twin primes, then b(p) = 1 and b(2*p) = -1; otherwise b(n) = 0. - Georg Fischer, Aug 15 2020

Examples

			a(46) = 2 because we have [41, 5] and [29, 17].
		

Crossrefs

Programs

  • Maple
    P:= select(isprime,{seq(i,i=3..201,2)}):
    TP:= P intersect map(`-`,P,2):
    G:= mul(1+x^p,p=TP):
    seq(coeff(G,x,i),i=0..200); # Robert Israel, Dec 15 2024
  • Mathematica
    nmax = 105; CoefficientList[Series[Product[1 + Boole[PrimeQ[k] && PrimeQ[k + 2]] x^k, {k, 1, nmax}], {x, 0, nmax}], x]

Formula

G.f.: Product_{k>=1} (1 + x^A001359(k)).
Showing 1-10 of 15 results. Next