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-3 of 3 results.

A072492 Values of n for which A072491(n)=3.

Original entry on oeis.org

27, 35, 51, 57, 65, 77, 87, 93, 95, 117, 119, 121, 122, 123, 125, 135, 143, 145, 147, 148, 155, 161, 171, 177, 185, 187, 189, 190, 203, 205, 207, 208, 209, 215, 217, 219, 220, 221, 237, 245, 247, 249, 250, 255, 261, 267, 275, 287, 289, 291, 292, 297, 299
Offset: 1

Views

Author

Amarnath Murthy, Jul 14 2002

Keywords

Comments

Define f(1) = 0. For n>=2, let f(n) = n - p where p is the largest prime <= n. A072491(n) = number of iterations of f to reach 0, starting from n.
p+4 is a term if p is a prime but p+2 and p+4 are both composite.

Examples

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

Crossrefs

Cf. A072491.

Programs

  • Mathematica
    f[1]=0; f[n_] := n-Prime[PrimePi[n]]; a72491[n_] := Module[{k, x}, For[k=0; x=n, x>0, k++; x=f[x], Null]; k]; Select[Range[300], a72491[ # ]==3&]

Extensions

Edited by Dean Hickerson, Nov 26 2002

A051034 Minimal number of primes needed to sum to n.

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
Offset: 2

Views

Author

Keywords

Examples

			a(2) = 1 because 2 is already prime.
a(4) = 2 because 4 = 2+2 is a partition of 4 into 2 prime parts and there is no such partition with fewer terms.
a(27) = 3 because 27 = 3+5+19 is a partition of 27 into 3 prime parts and there is no such partition with fewer terms.
		

Crossrefs

Programs

  • Mathematica
    (* Assuming Goldbach's conjecture *) a[p_?PrimeQ] = 1; a[n_] := If[ Reduce[ n == x + y, {x, y}, Primes] === False, 3, 2]; Table[a[n], {n, 2, 112}] (* Jean-François Alcover, Apr 03 2012 *)
  • PARI
    issum(n,k)=if(k==1,isprime(n),k--;forprime(p=2,n,if(issum(n-p,k),return(1)));0)
    a(n)=my(k);while(!issum(n,k++),);k \\ Charles R Greathouse IV, Jun 01 2011

Formula

a(n) = 1 iff n is prime. a(2n) = 2 (for n > 1) if Goldbach's conjecture is true. a(2n+1) = 2 (for n >= 1) if 2n+1 is not prime, but 2n-1 is. a(2n+1) >= 3 (for n >= 1) if both 2n+1 and 2n-1 are not primes (for sufficiently large n, a(2n+1) = 3 by Vinogradov's theorem, 1937). - Franz Vrabec, Nov 30 2004
a(n) <= 3 for all n, assuming the Goldbach conjecture. - N. J. A. Sloane, Jan 20 2007
a(2n+1) <= 5, see Tao 2012. - Charles R Greathouse IV, Jul 09 2012
Assuming Goldbach's conjecture, a(n) <= 3. In particular, a(p)=1; a(2*n)=2 for n>1; a(p+2)=2 provided p+2 is not prime; otherwise a(n)=3. - Sean A. Irvine, Jul 29 2019
a(2n+1) <= 3 by Helfgott's proof of Goldbach's ternary conjecture, and hence a(n) <= 4 in general. - Charles R Greathouse IV, Oct 24 2022

Extensions

More terms from Naohiro Nomoto, Mar 16 2001

A066352 Pillai sequence: a(n) is the smallest term in A007924 requiring n primes.

Original entry on oeis.org

0, 1, 4, 27, 1354, 401429925999155061
Offset: 0

Views

Author

Copied from www.primepuzzles.net by Frank Ellermann, Dec 19 2001

Keywords

Comments

a(5) computed independently in 2007 by R. J. Mathar and Luca & Thangadurai, both using Thomas Nicely's tables.
On Cramer's conjecture, the number of primes required is O(log* n), where log* is the iterated logarithm, so the rate of growth of a(n) is tetrational in n. - Charles R Greathouse IV, Aug 28 2010
The next term likely has hundreds of millions of digits. - Charles R Greathouse IV, Jun 29 2015

Examples

			The greatest prime <= 27 is 23; the greatest prime <= 27-23 is 3; 27-23-3 = 1, so the Pillai representation of 27 is 23+3+1, which uses more terms than all preceding numbers.
		

References

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

Crossrefs

Cf. A007924.

Programs

Formula

a(n) = 2*p(m) - p(m-1) with minimal m = pi(a(n)) so that p(m) = a(n-1) + p(m-1), where p(n) is A008578(n).

Extensions

Edited by Charles R Greathouse IV, Oct 28 2009
Entry rewritten by Charles R Greathouse IV, Aug 28 2010
Showing 1-3 of 3 results.