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

A201997 a(n) is the decimal value of the binary vector used to select terms of A075058 whose sum is n.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 48, 49, 50, 52, 53, 54, 55, 56, 57, 58, 60, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87
Offset: 0

Views

Author

Frank M Jackson, Dec 07 2011

Keywords

Examples

			For n=22, the binary vector when applied to A075058 is {0,1,0,1,1,0,...}, consequently 2+7+13=22. The decimal value of the binary vector (in ascending powers of 2) is 26, so a(22)=26.
		

Crossrefs

Programs

  • Mathematica
    prevprime[n_Integer] := (j=n; If[n==1, 1, While[!PrimeQ[j], j--]; j]); aprime[n_Integer] := (aprime[n]=prevprime[Sum[aprime[m], {m, 0, n - 1}] + 1]); gentable[n_Integer] := (m=n; ptable={0}; While[m!=0, (i=0; While[aprime[i]<=m && ptable[[i + 1]]!=1, (AppendTo[ptable, 0];i++)]; ptable[[i]] = 1; m = m - aprime[i - 1])]; ptable); decimal[n_Integer] := (gentable[n]; Sum[2^(k-1)*ptable[[k]], {k, 1, Length[ptable]}]); aprime[0]=1; Table[decimal[r], {r,0,100}]

Formula

Binary(a(n)) x A075058 = n, where x is the inner product and the binary vector is in ascending powers of 2 with infinite trailing zeros.

Extensions

Edited by N. J. A. Sloane, May 20 2023

A202618 a(n) is the smallest integer that is the sum of n distinct terms of A075058.

Original entry on oeis.org

0, 1, 4, 6, 19, 42, 89, 96, 289, 672, 1441, 2972, 6039, 12172, 24441, 48974, 98043, 196172, 392419, 784922, 1569939, 3139946, 6279987, 12560054, 25120201
Offset: 0

Views

Author

Frank M Jackson, Dec 21 2011

Keywords

Comments

Any nonnegative integer can be written as a sum of distinct terms of A075058. a(n) is the smallest integer that is the sum of n distinct terms of A075058 in the same way that A066352 gives a Pillai sequence for the sequence comprising 1 followed by all the primes.

Examples

			For n=5, the binary vector at A201997(54) is the smallest binary vector containing 5 1's and when applied to A075058 selects the integer 42. Consequently because 42=23+13+3+2+1 and 1,2,3,13,23 are all terms of the complete sequence A075058, a(5)=42.
		

Crossrefs

Programs

  • Mathematica
    prevprime[n_Integer] := (j=n;If[n==1, 1, While[!PrimeQ[j], j--]; j]);aprime[n_Integer] := (aprime[n]=prevprime[Sum[aprime[m], {m, 0, n - 1}]+1]);gentable[n_Integer] := (m=n;ptable={0};While[m!=0, (i=0;While[aprime[i]<=m && ptable[[i+1]]!=1, (AppendTo[ptable, 0];i++)];ptable[[i]] = 1;m=m-aprime[i - 1])];ptable);decimal[n_Integer] := (gentable[n];Sum[2^(k-1)*ptable[[k]], {k, 1, Length[ptable]}]);ones[n_Integer] :=(gentable[n];Sum[ptable[[k]], {k, 1, Length[ptable]}]);changeones[n_Integer] := (p = 0; While[ones[p] < n, p++]; p);aprime[0]=1;Table[changeones[r], {r, 0, 20}]

Formula

Find the smallest m such that binary(A201997(m)) x {1,1,1,...} = n, where x is the inner product, {1,1,1,1,...} is an infinite binary vector of 1's and binary(A201997(m)) a binary vector with infinite trailing zeros both in ascending powers of 2. Then a(n) = binary(m) x A075058, where x is the inner product and the binary vector is in ascending powers of 2 with infinite trailing zeros.

Extensions

Edited by N. J. A. Sloane, May 20 2023

A225947 Lexicographically least sequence of primes (including 1) that are sum-free.

Original entry on oeis.org

1, 2, 5, 11, 23, 43, 47, 137, 157, 293, 439, 1163, 1201, 2339, 3529, 5867, 9391, 23623, 24659, 49477, 72953, 147083, 195511, 392059, 538001, 1052479, 1590467, 2520503, 4503007, 5041007, 14047027, 15637483, 28239989, 55404001, 115994933, 210773399
Offset: 1

Views

Author

Frank M Jackson, May 21 2013

Keywords

Comments

A sum-free sequence has no term that is the sum of a subset of its previous terms. There are an infinite number of sequences that are subsets of {1} union primes and sum-free. This sequence is lexicographically the first.

Examples

			a(8)=137 as 137 is the next prime after a(7)=47 that cannot be formed from distinct sums of a(1),...,a(7) (1,2,5,11,23,43,47).
		

Crossrefs

Programs

  • Mathematica
    memberQ[n1_, k1_] := If[Select[IntegerPartitions[Prime[n1], Length[k1], k1], Sort@#==Union@# &]=={}, False, True]; k={1}; n=1; While[Length[k]<15, (If[!memberQ[n, k], k=Append[k, Prime[n]]]; n++)]; k

Extensions

a(23)-a(32) from Zak Seidov, May 23 2013

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

A185231 a(n) = largest prime <= 2a(n-1), with a(0)=1.

Original entry on oeis.org

1, 2, 3, 5, 7, 13, 23, 43, 83, 163, 317, 631, 1259, 2503, 5003, 9973, 19937, 39869, 79699, 159389, 318751, 637499, 1274989, 2549951, 5099893, 10199767, 20399531, 40799041, 81598067, 163196129, 326392249, 652784471, 1305568919, 2611137817
Offset: 0

Views

Author

N. J. A. Sloane, Jan 24 2012, following a suggestion from Frank M Jackson

Keywords

Comments

Equals 1 followed by A006992.
This is a complete sequence (cf. A075058).

Crossrefs

Programs

  • Mathematica
    np[n_]:=Module[{p=NextPrime[2n]},If[p<=2n,p,NextPrime[p,-1]]]; NestList[ np,1,40] (* Harvey P. Dale, Sep 29 2019 *)
  • PARI
    lista(nn) = {p = 1; for (n = 1, nn, print1(p, ", "); p = precprime(2*p););} \\ Michel Marcus, Aug 26 2013

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