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.

A075058 Lexicographically earliest infinite sequence of distinct positive numbers with the property that every positive integer is a sum of distinct terms (see algorithm below).

Original entry on oeis.org

1, 2, 3, 7, 13, 23, 47, 97, 193, 383, 769, 1531, 3067, 6133, 12269, 24533, 49069, 98129, 196247, 392503, 785017, 1570007, 3140041, 6280067, 12560147, 25120289, 50240587, 100481167, 200962327, 401924639, 803849303, 1607698583, 3215397193, 6430794373
Offset: 0

Views

Author

Amarnath Murthy, Sep 07 2002

Keywords

Comments

This sequence starts with a(0)=1, subsequent terms a(n) for n > 0 being obtained by selecting the greatest prime <= 1 + Sum_{i=0..n-1} a(i). This ensures that the sequence has the required property because Sum_{i=0..n-1} a(i) >= a(n) - 1, for all n >= 0 and a(0)=1, is a necessary and sufficient condition for it to hold.

Examples

			Given that the first 7 terms of the sequence are 1,2,...,23,47 then a(8)=(greatest prime) <= (1+2+...+23,47) + 1 = 97, hence a(8)=97.
		

Crossrefs

Programs

  • Mathematica
    prevprime[n_Integer] := (j=n; While[!PrimeQ[j], j--]; j) aprime[0]=1; aprime[n_Integer] := (aprime[n] = prevprime[Sum[aprime[m], {m, 0, n - 1}] + 1]); Table[aprime[p], {p, 0, 50}]
    a[0] = 1; a[n_] := a[n] = NextPrime[Sum[a[k], {k, 0, n-1}]+2, -1]; Table[a[n], {n, 0, 33}] (* Jean-François Alcover, Sep 30 2013 *)
  • PARI
    print1(s=1);for(n=1,20,k=precprime(s+1);print1(", "k);s+=k) \\ Charles R Greathouse IV, Apr 05 2013

Formula

a(n) = (greatest prime) <= 1 + Sum_{i=0..n-1} a(i).
a(n) ~ k*2^n, with k roughly 0.748643. - Charles R Greathouse IV, Apr 05 2013

Extensions

Entry revised by Frank M Jackson, Dec 03 2011
Edited by N. J. A. Sloane, May 20 2023

A123196 a(1) = 2; a(n+1) = a(n) + p, where p is the largest prime <= a(n).

Original entry on oeis.org

2, 4, 7, 14, 27, 50, 97, 194, 387, 770, 1539, 3070, 6137, 12270, 24539, 49072, 98141, 196270, 392517, 785020, 1570037, 3140044, 6280085, 12560152, 25120299, 50240588, 100481175, 200962342, 401924669, 803849308, 1607698611, 3215397194
Offset: 1

Views

Author

Peter C. Heinig (algorithms(AT)gmx.de), Oct 04 2006

Keywords

Comments

Old Name was: Jumping along the natural numbers, starting at the first prime and letting the greatest prime reached so far determine the length of the next jump, when "reached" is defined as "jumped over" as well as "landed on".
Note that the infinitude of this sequence follows from Bertrand's postulate.
From David James Sycamore, Apr 07 2017: (Start)
Among the first 500 terms, the primes are a(1)=2, a(3)=7, a(7)=97, a(107)=121474271192355984857330583869867, a(131), a(213), a(263), and a(363).
The underlying sequence of added primes is A075058 and A068524, without their first terms (1 & 2 respectively). (End)

Examples

			a(1)=2 since 2 is the first prime. a(3)=7 since having landed at 4, the greatest prime reached so far is 3. a(8)=194=97+97 since with the preceding term we had landed on a prime. a(17)=98141 since having passed the prime 49069 with the term a(16) but not having reached the prime 49081, we have to add the former and indeed 98141=49069+49072.
		

Crossrefs

Programs

  • Maple
    a[1]:=2; for k from 1 to 29 do x:=a[k]: if isprime(x) then a[k+1]:=x+x: else y:=x: while not(isprime(y)) do y:=y-1:od; a[k+1]:= x+y: fi;od;
  • Mathematica
    a[1]=2; a[n_]:= a[n] = If[PrimeQ[a[n-1]], 2 a[n-1], a[n-1] + NextPrime[ a[n-1], -1]]; Array[a, 100] (* Giovanni Resta, Apr 08 2017 *)
  • PARI
    lista(nn) = { print1(a=2, ", "); for (n=2, nn, na = a + precprime(a); print1(na, ", "); a = na;);} \\ Michel Marcus, Apr 08 2017

Extensions

New name from David James Sycamore, Apr 07 2017

A285010 a(n+1) = a(n) + p, where p is the largest prime less than a(n); a(1) = 3.

Original entry on oeis.org

3, 5, 8, 15, 28, 51, 98, 195, 388, 771, 1540, 3071, 6138, 12271, 24540, 49073, 98142, 196271, 392518, 785021, 1570038, 3140045, 6280086, 12560153, 25120300, 50240589, 100481176, 200962343, 401924670, 803849309, 1607698612, 3215397195, 6430794388, 12861588761, 25723177510
Offset: 1

Views

Author

David James Sycamore, Apr 07 2017

Keywords

Comments

After a(1) the sequence alternates between odd and even numbers (obviously).
There is at least 1 prime between p and 2p (Bertrand), and since there is no prime between p and a(n) there must be at least one prime between a(n) and a(n) + p. Hence the sequence continues indefinitely, and each added prime is added once only.
The underlying sequence of added primes is: 2, 3, 7, 13, 23, 47, 97, ...; namely A075028 or A068524 but without their initial terms (1, 2 respectively).
Four primes occur in the first 24 terms, a(1) = 3, a(2) = 5, a(18) = 196271, and a(24) = 12560153, suggesting a higher density of primes here than in related sequence A123196, in which only three primes arise in the first 500 terms. It would be interesting to examine this further, once more terms become available.

Examples

			a(1) = 3, the first odd prime. The greatest prime less than 3 is 2, so a(2) = 3 + 2 = 5. Greatest prime less than 5 is 3 so a(3) = 5 + 3 = 8. Likewise a(4) = 8 + 7 = 15; etc.
		

Crossrefs

Programs

  • Mathematica
    a[1]=3; a[n_] := a[n] = a[n-1] + NextPrime[a[n-1], -1]; Array[a, 35] (* Giovanni Resta, Apr 10 2017 *)
    NestList[#+NextPrime[#,-1]&,3,40] (* Harvey P. Dale, Aug 22 2020 *)
  • PARI
    lista(nn) = { print1(a=3, ", "); for (n=2, nn, a += precprime(a-1); print1(a, ", ");); } \\ Michel Marcus, Apr 08 2017

Formula

a(n) ~ c * 2^n, where c = 0.748642996358317338.... - Bill McEachen, May 09 2024

Extensions

More terms from Michel Marcus, Apr 08 2017
Showing 1-3 of 3 results.