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.

A350877 The Sisyphus sequence: start the sequence S with a(1) = 1 and extend S with a(n)/2 when a(n) is even, otherwise with a(n) + the smallest prime not yet added.

Original entry on oeis.org

1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, 16, 8, 4, 2, 1, 18, 9, 28, 14, 7, 30, 15, 44, 22, 11, 42, 21, 58, 29, 70, 35, 78, 39, 86, 43, 96, 48, 24, 12, 6, 3, 62, 31, 92, 46, 23, 90, 45, 116, 58, 29, 102, 51, 130, 65, 148, 74, 37, 126, 63, 160, 80, 40, 20, 10, 5, 106, 53, 156, 78, 39, 146, 73, 182, 91
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Jan 22 2022

Keywords

Comments

Will every positive integer appear in S?
Comment from Allan C. Wechsler, Jan 22 2022: (Start)
Conjecture: On naive probabilistic grounds, all integers should eventually appear. An up-step is always immediately followed by a down-step, and then, on average, by one more down-step. So we expect that every third step will be an up-step, by the next prime number, which will be around p(n/3).
So the sequence will spend a lot of its time between p(n/3)/3 and 4p(n/3)/3. It will make brief forays out of that zone but that will be its "home ground". The scatterplot should be instructive.
Now p(n/3) grows really slowly. It will take longer than 2^k steps to get from 2^k to 2^(k+1), and so there will be long downward excursions very roughly once in each such "era". Each of these long downward excursions has a nonzero chance of hitting any particular number N, and that chance won't decrease as the eras pass. So while we may not be able to calculate the sequence far enough to reach N, I think we can have fairly high confidence that all integers will appear. It would be interesting to study a histogram of how frequently the small integers appear. (End)
After 10^9 terms the missing numbers are 36, 72, 97, 115, 127, 144, 167, 194, 211, ... - Hans Havermann, Jan 22 2022
After 10^12 terms, the missing numbers are 97, 115, 127, 167, 194, 211, 230, 232, 254, ...; a(77534485875) = 144, a(77534485876) = 72, and a(77534485877) = 36. - Russ Cox, Jan 23 2022
a(17282073747556) = 194, a(17282073747557) = 97. - Martin Ehrenstein, Jan 26 2022 [Where does this descending chain start? - N. J. A. Sloane, Jan 27 2022]
From Martin Ehrenstein, Jan 29 2022: (Start)
36 is part of a descending chain that ends with a(77534485879) = 9 and starts with a(77534485842) = 1236950581248 after adding the prime 677121348413.
a(17282073747557) = 97 ends a descending chain that starts with a(17282073747516) = 213305255788544 after adding the prime 183236837077571.
a(45274461582754) = 115 ends a descending chain that starts with a(45274461582712) = 505775348776960 after adding the prime 495047540307647.
After 5*10^13 terms, the missing numbers are 127, 167, 211, 232, 254, ... (End)

Examples

			S = 1, ...
1 is odd, we add the prime 2:
S = 1, 3, ...
3 is odd, we add the next prime, 3:
S = 1, 3, 6, ...
6 is even, we divide by 2:
S = 1, 3, 6, 3, ...
3 is odd, we add the next prime, 5:
S = 1, 3, 6, 3, 8, ...
8 is even we divide by 2 (etc.):
S = 1, 3, 6, 3, 8, 4, 2, 1, ...
1 is odd, we add the next prime, 7:
S = 1, 3, 6, 3, 8, 4, 2, 1, 8, ...
8 is even, we divide by 2 (etc.):
S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, ...
1 is odd, we add the next prime, 11:
S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, ...
12 is even, we divide by 2 (etc.):
S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, ...
3 is odd, we add the next prime, 13:
S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, 16, ...
16 is even, we divide by 2 (etc.):
S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, 16, 8, 4, 2, 1, ...
1 is odd, we add the next prime, 17:
S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, 16, 8, 4, 2, 1, 18, ...
18 is even, we divide by 2:
S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, 16, 8, 4, 2, 1, 18, 9, ...
9 is odd, we add the next prime, 19:
S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, 16, 8, 4, 2, 1, 18, 9, 28, ...
Etc.
		

Crossrefs

A350615 gives indices of 1's, A350616 gives indices of odd terms. See also A350617, A350618, A350619, A350833, A362107, A362108.
See A350620 for when n first appears, A350621 for when the primes first appear, and A362105 and A362106 for the numbers that are the slowest to appear.

Programs

  • Maple
    # To produce M terms in b-file format:
    M:=100000;
    p:=1; L:=1;
    for n from 1 to M do
    if n=1 then lprint(n,L);
    else if (L mod 2) = 0 then L := L/2;
         else p:=nextprime(p); L:=L+p;
         fi;
    lprint(n,L);
    fi;
    od: # N. J. A. Sloane, Jan 28 2022
  • Mathematica
    j = 1; q = 2; {j}~Join~Reap[Do[If[EvenQ[j], k = j/2, k = j + q; Set[q, NextPrime[q]]]; Sow[k]; j = k, {i, 79}]][[-1, -1]] (* Michael De Vlieger, Jan 22 2022 *)
    nxt[{sp_,n_,a_}]:=Module[{p=2,c},c=If[EvenQ[a],a/2,a+sp];{If[EvenQ[ a],sp,NextPrime[sp]],n+1,c}]; NestList[nxt,{2,1,1},80][[All,3]] (* Harvey P. Dale, Jan 23 2022 *)
  • PARI
    { print1 (v=1); forprime (p=2, 109, print1 (", "v+=p); while (v%2==0, print1 (", "v/=2))) } \\ Rémy Sigrist, Jan 23 2022
    
  • PARI
    A350877_first(N,p=0)=vector(N,i,N=if(!p,p=1,N%2,N+p=nextprime(p+1),N/2)) \\ M. F. Hasler, Jan 23 2022
    
  • Python
    from sympy import nextprime
    a, p = [1], 1
    [a.append(a[-1]//2 if a[-1]%2 == 0 else a[-1]+(p:=nextprime(p))) for n in range(79)]
    print(a) # Michael S. Branicky, Jan 23 2022

Extensions

Added name Sisyphus sequence. - N. J. A. Sloane, Jan 23 2022

A350616 Indices of odd terms in A350877.

Original entry on oeis.org

1, 2, 4, 8, 12, 15, 20, 22, 25, 27, 30, 32, 34, 36, 38, 40, 46, 48, 51, 53, 56, 58, 60, 63, 65, 71, 73, 76, 78, 80, 83, 85, 88, 95, 97, 100, 102, 105, 108, 114, 117, 123, 126, 128, 132, 135, 137, 140, 143, 148, 152, 156, 161, 163, 166, 172, 174, 176, 178, 180, 182, 186, 188, 192, 195, 197, 201, 204, 207, 211, 213
Offset: 1

Views

Author

N. J. A. Sloane, Jan 23 2022

Keywords

Comments

If we add 1 to these terms we get 2, 3, 5, 13, 16, 21, 23, 26, 28, 33, ..., which are the locations of record high points in A350877.

Crossrefs

Programs

  • Mathematica
    j = 1; q = 2; {j}~Join~Reap[Do[If[EvenQ[j], Set[k, j/2], Set[k, j + q]; Set[q, NextPrime[q]]]; If[OddQ[k], Sow[i]]; j = k, {i, 2, 213}]][[-1, -1]] (* Michael De Vlieger, Jan 23 2022 *)
  • PARI
    A350616_upto(N)=select(t->t%2, A350877_first(N), 1) \\ M. F. Hasler, Jan 23 2022

A350617 Odd-valued terms in A350877.

Original entry on oeis.org

1, 3, 3, 1, 1, 3, 1, 9, 7, 15, 11, 21, 29, 35, 39, 43, 3, 31, 23, 45, 29, 51, 65, 37, 63, 5, 53, 39, 73, 91, 51, 89, 55, 3, 71, 55, 103, 65, 57, 7, 45, 7, 47, 119, 39, 59, 129, 85, 77, 19, 31, 33, 17, 129, 95, 11, 137, 203, 237, 257, 269, 69, 181, 61, 93, 203, 65, 99, 109, 57, 203, 139, 249, 77, 225, 151, 267, 41, 219, 155
Offset: 1

Views

Author

N. J. A. Sloane, Jan 23 2022

Keywords

Crossrefs

Programs

  • Mathematica
    j = 1; q = 2; {j}~Join~Reap[Do[If[EvenQ[j], Set[k, j/2], Set[k, j + q]; Set[q, NextPrime[q]]]; If[OddQ[k], Sow[k]]; j = k, {i, 2, 240}]][[-1, -1]] (* Michael De Vlieger, Jan 23 2022 *)

A350619 Record high values in A350877.

Original entry on oeis.org

1, 3, 6, 8, 12, 16, 18, 28, 30, 44, 58, 70, 78, 86, 96, 116, 130, 148, 160, 182, 204, 220, 260, 312, 340, 380, 406, 474, 514, 538, 552, 556, 616, 656, 686, 786, 842, 878, 900, 918, 958, 982, 1000, 1092, 1190, 1272, 1290, 1378, 1428, 1432, 1540, 1612, 1776, 1880, 1946, 2126, 2226, 2284, 2290
Offset: 1

Views

Author

N. J. A. Sloane, Jan 23 2022

Keywords

Crossrefs

Programs

  • Mathematica
    r = 0; j = 1; q = 2; {j}~Join~Reap[Do[If[EvenQ[j], Set[k, j/2], Set[k, j + q]; Set[q, NextPrime[q]]]; If[k > r, Sow[k]; r = k]; j = k, {i, 2, 645}]][[-1, -1]] (* Michael De Vlieger, Jan 23 2022 *)

A350621 a(n) is the smallest k such that A350877(k) = prime(n), or -1 if prime(n) does not appear in A350877.

Original entry on oeis.org

7, 2, 71, 25, 30, 345, 161, 148, 51, 34, 48, 63, 234, 40, 126, 73, 135, 192, 454, 97, 78, 24841, 433, 85, 17282073747557, 322, 102, 106544217, 207, 556
Offset: 1

Views

Author

N. J. A. Sloane, Jan 23 2022

Keywords

Comments

Based on the data in A350620.

Crossrefs

Extensions

a(25)-a(30) from Martin Ehrenstein, Jan 26 2022

A350833 Run lengths of even terms in A350877 (half if even, add next prime if odd).

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Jan 23 2022

Keywords

Comments

Equals first differences of indices of odd terms (A350616) minus one.
After the initial 0, also equals the 2-valuation (A007814) of A350618, the terms following odd terms in A350877.
Record values are a(1) = 0, a(2) = 1, a(3) = 3, a(6) = 4, a(16) = 5, a(33) = 6, a(146) = 7, a(243) = 11, a(1596) = 12, a(2092) = 13, ... The first occurrences of the other values are: a(5) = 2, a(8) = 510, a(9) = 667, a(10) = 1526. No others up to n = 33000. - M. F. Hasler, Jan 24 2022

Examples

			Between the first odd term, A350877(1) = 1, and second odd term, A350877(2) = 3, there are no even terms, therefore a(1) = 0.
Between the second and third odd term, A350877(4) = 3, there is one even term, A350877(3) = 6, therefore a(2) = 1.
		

Crossrefs

Programs

Formula

a(n) = A350616(n+1) - A350616(n) - 1 = A007814(A350618(n-1)) for n > 1.
Showing 1-6 of 6 results.