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
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.
- Charles R Greathouse IV, Table of n, a(n) for n = 0..1000
- Wikipedia, "Complete" sequence. [Wikipedia calls a sequence "complete" (sic) if every positive integer is a sum of distinct terms. This name is extremely misleading and should be avoided. - _N. J. A. Sloane_, May 20 2023]
-
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 *)
-
print1(s=1);for(n=1,20,k=precprime(s+1);print1(", "k);s+=k) \\ Charles R Greathouse IV, Apr 05 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
Peter C. Heinig (algorithms(AT)gmx.de), Oct 04 2006
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.
-
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;
-
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 *)
-
lista(nn) = { print1(a=2, ", "); for (n=2, nn, na = a + precprime(a); print1(na, ", "); a = na;);} \\ Michel Marcus, Apr 08 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
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.
-
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 *)
-
lista(nn) = { print1(a=3, ", "); for (n=2, nn, a += precprime(a-1); print1(a, ", ");); } \\ Michel Marcus, Apr 08 2017
Showing 1-3 of 3 results.
Comments