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

A293980 Number of iterations of A174221 (the PrimeLatz map) required to enter a loop, for initial value n, or -1 if this never happens.

Original entry on oeis.org

0, 1, 2, 1, 3, 1, 2, 6, 4, 0, 2, 0, 3, 0, 7, 0, 5, 0, 0, 14, 3, 0, 0, 2, 4, 0, 0, 21, 8, 29, 0, 18, 6, 12, 0, 69, 0, 0, 15, 66, 4, 6, 0, 21, 0, 15, 3, 31, 5, 39, 0, 12, 0, 3, 22, 28, 9, 2, 30, 25, 0, 0, 19, 6, 7, 30, 13, 19, 0, 27, 70, 11, 0, 24, 0, 30, 16, 10, 67, 15, 5, 21, 7, 16180, 0
Offset: 0

Views

Author

M. F. Hasler, Oct 25 2017

Keywords

Comments

Apart from the fixed point 0, the only known loop of A174221 appears to be (9, 50, 25, 122, 61, 272, 136, 68, 34, 17, 88, 44, 22, 11, 60, 30, 15, 74, 37, 168, 84, 42, 21, 104, 52, 26, 13, 72, 36, 18), of length 30. This has been verified up to 10^8.
The trajectory of all positive numbers considered so far enters this loop.
If n is a term of that loop (or n = 0), then a(n) = 0. For any positive integer not part of this loop, a(n) is the number of iterations of A174221 until an element of this loop is reached. It can also be defined as the number of iterations until reaching a number which already occurred earlier in the orbit, minus the number of iterations needed to see that number again (which appears to be 30 for all positive integers).
The trajectory of most positive integers merges very soon (say, in a(n) < 100 steps for most n < 1000) into the above loop. For example, starting with 1, one enters this loop right after the first iteration, cf. A193230.
The most remarkable exception is n = 83, which has an orbit of 16180 + 30 elements. A few other small numbers (141, 147, 151, 161, 166, 185, ...) merge within a few steps into the same trajectory (cf. examples), and have an orbit of roughly the same size. See A293979 for more about the trajectory of 83.
The number n = 443 is another exception, with a(n) = 9066, and a trajectory that merges into that of 83 only after 8853 iterations, cf. A293978.
The numbers 418 -> 209 -> 870 -> 435 -> ... also have a comparatively large orbit of about 940 + 30 elements, completely disjoint from that of 83 apart from the loop (which is entered at the value 60, while the orbit of 83 enters it at 26).

Examples

			Starting with 1 (cf. A193230), one gets 1 -> A174221(1) = (1 + 2 + 3 + 5) = 11 which is part of the loop, therefore a(1) = 1. Without having precomputed the loop, one can also iterate until a value occurs for the second time. This would give 1 -> 11 -> 60 -> 30 -> 15 -> 74 -> 37 -> 168 -> 84 -> 42 -> 21 -> 104 -> 52 -> 26 -> 13 -> 72 -> 36 -> 18 -> 9 -> 50 -> 25 -> 122 -> 61 -> 272 -> 136 -> 68 -> 34 -> 17 -> 88 -> 44 -> 22 -> 11: After 31 iterations one gets again 11 which was already there after the first iteration. Since the loop is of length 30, it was entered after 31 - 30 = 1 iteration(s).
Starting with 83, it takes 16179 iterations to reach 3 (not yet in the loop) and one more to reach 26, an element of the loop. In this orbit, the largest value is 10780054699424618132644155893087038044817868609971935265882538442720, reached after 8337 iterations. See A293979 for the trajectory of 83.
The few other n (141, 147, 151, 161, 166, 185, ...) which have an orbit larger than 100 elements mostly have trajectories that merge quite soon into that of 83 (-> 370 -> 185, and 161 -> 664 -> 332 -> 166 -> 83, and 147 -> 604 -> 302 -> 151 -> (6 more steps) -> 675 -> 2726 -> (23 more steps) -> 370, and 141 -> (36 more steps) -> 5452 -> 2726. Therefore these have an orbit of roughly the same size, a(n) ~ 16200. See the comments for the exceptions.
		

Crossrefs

Cf. A174221 (main entry), A174223.
Cf. A193230 (orbit of 1), A293979 (orbit of 83), A293978 (orbit of 443).

Programs

  • Mathematica
    Array[LengthWhile[#, Function[k, k != Last@ #]] &@ NestWhileList[If[EvenQ@ #, #/2, Total@ Prepend[NextPrime[#, {1, 2, 3}], #]] &, #, UnsameQ, All] &, 82] (* Michael De Vlieger, Oct 25 2017 *)
  • PARI
    S=Set(vector(t=30,i,t=A174221(t))); A293980(n)={n&&for(k=0,oo,setsearch(S,n)&&return(k);n=A174221(n))} \\ Uses the hypothesis that Orbit(30) = Orbit(9) is the only "loop". (Precomputed and stored in global variable S.)
    A293980(n,A=vector(30))={n&&for(k=0,oo,A[k%30+1]==n&&return(k-30);n=A174221(A[k%30+1]=n))} \\ Alternative code: store the 30 most recently computed values and stop when a(k) = a(k-30). Roughly the same speed; does not require the precomputed loop & global variable S. Would also work for another hypothetical loop of length 30. Could easily be modified to detect loops of other length, not without performance hit: most efficient would probably be to keep both, a sorted (Set) and unsorted (i.e., "chronological") record of the last N values.)

A293979 Start with 83; if even, divide by 2; if odd, add next three primes: Orbit of 83 under iterations of A174221, the "PrimeLatz" map.

Original entry on oeis.org

83, 370, 185, 766, 383, 1570, 785, 3178, 1589, 6394, 3197, 12826, 6413, 25710, 12855, 51536, 25768, 12884, 6442, 3221, 12954, 6477, 25970, 12985, 51996, 25998, 12999, 52010, 26005, 104072, 52036, 26018, 13009, 52122, 26061, 104350, 52175, 208716, 104358
Offset: 0

Views

Author

M. F. Hasler, Oct 26 2017

Keywords

Comments

Periodic with period of length 30, starting at a(16180) = 26.
Angelini conjectures that the trajectory under A174221 becomes periodic for any initial value. He called this the PrimeLatz conjecture (as tribute to L. Collatz, known for the 3n+1 conjecture).
It has been checked that the loop (9, ..., 18) (= A193230(19..48)) is the only loop (except for the fixed point 0) at least up to values not exceeding 10^8, and the trajectory of every positive integer <= 10^4 does end in this loop.
See A293980 for the number of iterations required to reach an element of this loop, depending on the starting value.
Most small initial values have a very small orbit of few more than the 30 elements of the loop. N = 83 = a(0) is the most remarkable exception (having an orbit of 16180 + 30 elements), which motivates this sequence. Of course, the trajectory of any N = a(n)*2^k, e.g., 2*83 = 166, 4*83 = 332, 8*83 = 664, 2*370 = 740, ..., merges into the same orbit after k steps.
N = 443 = A293978(0) is another exception, with an orbit of 9066+30 elements (see A293978), and N = 209 also has a comparatively large orbit of 941 + 30 elements, distinct from those of 83 and 443.

Examples

			The initial value a(0) = 83 is odd, so we add to 83 the next 3 primes (89, 97 and 101) to get a(1) = 370.
370 is even, so we divide by 2 to get a(2) = 185, and so on.
After 8337 iterations, we get a(8337) = 10780054699424618132644155893087038044817868609971935265882538442720. This is the largest value we will reach. Since this is even we divide by 2 to get a(8338).
The result a(8338) is again even, so we divide by 2 once more to get a(8339), and so on...
After iteration 16171, we reach a(16171) = 768. The next 8 iterations consist of dividing by 2, until we get a(16179) = 3. Since this is odd, we add the next three primes (5, 7 and 11) to reach a(16180) = 26 = A193230(14). This is an element of the loop: 30 iterations later, we get again 26, and the sequence has become periodic.
		

Crossrefs

Cf. A174221, A293980, A293978 (orbit of 443), A193230 (orbit of 1).

Programs

  • Mathematica
    NestList[If[EvenQ@ #, #/2, Total@ Prepend[NextPrime[#, {1, 2, 3}], #]] &, 83, 101]
  • PARI
    vector(100,i,t=if(i>1,A174221(t),83))

A293978 Start with 443; if even, divide by 2; if odd, add next three primes: Orbit of 443 under iterations of A174221, the "PrimeLatz" map.

Original entry on oeis.org

443, 1810, 905, 3642, 1821, 7322, 3661, 14682, 7341, 29410, 14705, 58858, 29429, 117762, 58881, 235568, 117784, 58892, 29446, 14723, 58932, 29466, 14733, 58958, 29479, 117990, 58995, 236012, 118006, 59003, 236044, 118022, 59011, 236084, 118042, 59021, 236124, 118062, 59031, 236198, 118099, 472536, 236268
Offset: 0

Views

Author

M. F. Hasler, Oct 26 2017

Keywords

Comments

Periodic with period 30, starting at a(9066) = 26 = A193230(14), see there for the next 30 elements which form the repeating part, a.k.a. loop.
Angelini conjectures that the orbit under A174221 becomes periodic for any initial value. He calls this the PrimeLatz conjecture (as a tribute to L. Collatz, known for the 3n+1 conjecture).
It has been checked that the loop (9, ..., 18) (= A193230(19..48)) is the only loop (except for the fixed point 0) at least up to values not exceeding 10^8, and the orbit of every positive integer <= 10^4 does end in this loop. See A293980 for the number of iterations required to reach an element of this loop.
Most small numbers (say, n < 1000) have very small orbits, and they converge into the above mentioned loop within a few iterations. The most remarkable exception is n = 83, whose orbit of 16210 elements is given in A293979. The second largest orbit (for "small" initial values) is that of 443, given here. It merges only near the end into that of 83, cf. Example section. Of course, the trajectory of any N = a(n)*2^k, e.g. 2*443 = 886, merges into the same orbit after k steps.

Examples

			The initial value a(0) = 443 is odd, so we add to 443 the next 3 primes (449, 457 and 461) to get a(1) = 1810.
1810 is even, so we divide by 2 to get a(2) = 905, and so on.
After 2324 iterations, we get a(2324) = 4691214813495590981789155675545600. This is the largest value we will reach.
Since a(2324) is even, we divide by 2 to get a(2325), which is again even. This happens 12 times in a row; only after dividing by 2 for 13 times do we again reach an odd value, a(2337).
After 8853 iterations, we reach a(8853) = 3702 = A293979(15967). From here on, the tail of the orbit is the same as that of 83: 212 iterations later we get a(9065) = 3. Since this is odd, we add the next three primes (5, 7 and 11) to reach a(9066) = 26 = A193230(14). This is an element of the loop: 30 iterations later, we again get 26, and the sequence has become periodic.
		

Crossrefs

Cf. A174221, A293980, A293979 (orbit of 83), A193230 (orbit of 1, includes the "loop" from the 2nd term of that sequence on).

Programs

  • Mathematica
    NestList[If[EvenQ@ #, #/2, Total@ Prepend[NextPrime[#, {1, 2, 3}], #]] &, 83, 101]
  • PARI
    vector(100,i,t=if(i>1,A174221(t),443))

A293981 Start with 209; if even, divide by 2; if odd, add the next three primes: Trajectory of 209 under iterations of A174221, the "PrimeLatz" map.

Original entry on oeis.org

209, 870, 435, 1766, 883, 3588, 1794, 897, 3634, 1817, 7318, 3659, 14680, 7340, 3670, 1835, 7410, 3705, 14860, 7430, 3715, 14894, 7447, 29814, 14907, 59698, 29849, 119430, 59715, 238910, 119455, 477960, 238980, 119490, 59745, 239016, 119508, 59754, 29877, 119554, 59777
Offset: 0

Views

Author

M. F. Hasler, Oct 31 2017

Keywords

Comments

Periodic with period of length 30, starting at a(941) = 60.
Angelini conjectures that the trajectory under A174221 becomes periodic for any initial value. He called this the PrimeLatz conjecture (as tribute to L. Collatz, known for the 3n+1 conjecture).
It has been checked that the loop (9, ..., 18) (= A193230(19..48)) is the only loop (except for the fixed point 0) at least up to values not exceeding 10^8 (result due to Hans Havermann), and the trajectory of every positive integer <= 10^4 does end in this loop.
See A293980 for the number of iterations required to reach an element of this loop, depending on the starting value.
Most small initial values have a very small orbit of few more than the 30 elements of the loop. N = 83 = A293979(0) is the most remarkable exception, having an orbit of 16180 + 30 elements, cf. A293979.
N = 443 = A293978(0) is another exception, with an orbit of 9066+30 elements (see A293978).
N = 209 has the third largest genuinely different orbit among small initial values (of course, any N = 2^k*a(n) merges into the sequence a(n) after k steps), of 941 + 30 elements. This motivates the present sequence.
The fact that the loop is entered at a(941) = 60 = A193230(2), while the trajectories of 83 and 443 enter the loop at the term 26 = A193230(14), prove that this orbit is genuinely different from that of 83 and 443.
The horizontal rays in the graph correspond to factors of 2: division by 2 is one possible step, and for large numbers adding the next 3 primes roughly amounts to multiplying the value by 4, the prime gaps being "negligible".

Examples

			The initial value a(0) = 209 is odd, so we add to 209 the next 3 primes (211, 223 and 227) to get a(1) = 870.
a(1) = 870 is even, so we divide by 2 to get a(2) = 435, and so on.
After 667 iterations, we get a(667) = 517468668525760. This is the largest value we will reach. Since this is even we divide by 2 to get a(668).
The result a(668) is again even, so we divide by 2 once more to get a(669), and so on...
After iteration 935, we reach a(935) = 3840. The next 6 iterations consist of dividing by 2, until we get a(941) = 60 = A193230(2). This is an element of the loop: after dividing two more times by 2 and 28 other iterations later, we get again 60, and the sequence has become periodic.
		

Crossrefs

Cf. A174221, A293980, A293979 (orbit of 83), A293978 (orbit of 443), A193230 (orbit of 1, essentially the apparently unique "loop" of A174221).

Programs

  • Mathematica
    NestList[If[EvenQ@ #, #/2, Total@ Prepend[NextPrime[#, {1, 2, 3}], #]] &, 83, 101]
  • PARI
    vector(100,i,t=if(i>1,A174221(t),209))

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

A193230 Start with 1; if even, divide by 2; if odd, add the next three primes.

Original entry on oeis.org

1, 11, 60, 30, 15, 74, 37, 168, 84, 42, 21, 104, 52, 26, 13, 72, 36, 18, 9, 50, 25, 122, 61, 272, 136, 68, 34, 17, 88, 44, 22, 11, 60, 30, 15, 74, 37, 168, 84, 42, 21, 104, 52, 26, 13, 72, 36, 18, 9, 50, 25, 122, 61, 272, 136, 68, 34, 17, 88, 44, 22, 11, 60, 30, 15, 74, 37, 168, 84, 42, 21, 104, 52, 26, 13, 72, 36, 18, 9, 50, 25, 122, 61, 272, 136, 68, 34, 17, 88, 44, 22, 11, 60, 30, 15, 74, 37, 168, 84, 42, 21, 104
Offset: 1

Views

Author

N. J. A. Sloane, Jul 18 2011

Keywords

Comments

Trajectory of 1 under the map x -> A174221(x).
Periodic with period of length 30, starting at a(2) = 11.
Angelini conjectures that the orbit under A174221 becomes periodic for any initial value. He calls this the PrimeLatz conjecture, as tribute to L. Collatz, known for the 3n+1 conjecture.
It has been checked that the loop (11, ..., 22) (or (9, ..., 18), to start with the smallest element) is the only loop (except for the fixed point 0) at least up to values not exceeding 10^8, and the orbit of every positive integer <= 10^4 does end in this loop. - M. F. Hasler, Oct 25 2017
It might have been more natural to start this sequence with offset 0. Since a(n) = a(n+30) from n = 2 on, this sequence consists essentially (except for the initial term) of the apparently unique "loop" of the "PrimeLatz" map A174221. It is used as such in related sequences A293978, ... - M. F. Hasler, Oct 31 2017

Examples

			1 is odd;  we add to 1 the next 3 primes (2,3,5) and get 11
11 is odd;  we get 11+(13+17+19)=60
60 is even; we get 30
30 is even; we get 15
15 is odd;  we get 15+(17+19+23)=74
74 is even; we get 37
37 is odd;  we get 37+(41+43+47)=168
168 is even; we get 84
84 is even; we get 42
42 is even; we get 21
21 is odd;  we get 21+(23+29+31)=104
104 is even; we get 52
52 is even; we get 26
26 is even; we get 13
13 is odd;  we get 13+(17+19+23)=72
72 is even; we get 36
36 is even; we get 18
18 is even; we get 9
9 is odd;  we get 9+(11+13+17)=50
50 is even; we get 25
25 is odd;  we get 25+(29+31+37)=122
122 is even; we get 61
61 is odd;  we get 61+(67+71+73)=272
272 is even; we get 136
136 is even; we get 68
68 is even; we get 34
34 is even; we get 17
17 is odd;  we get 17+(19+23+29)=88
88 is even; we get 44
44 is even; we get 22
22 is even; we get 11... thus entering in a loop.
...
(from Angelini's web page)
		

Crossrefs

Cf. A174221, A293980, A293979 (orbit of 83), A293978 (orbit of 443), A293981 (orbit of 209).

Programs

  • Mathematica
    NestList[If[EvenQ@ #, #/2, Total@ Prepend[NextPrime[#, {1, 2, 3}], #]] &, 1, 101] (* Michael De Vlieger, Oct 25 2017 *)
  • PARI
    vector(100,i,t=if(i>1,A174221(t),1)) \\ M. F. Hasler, Oct 25 2017

A293975 If n is even, divide by 2; otherwise, add the next larger prime.

Original entry on oeis.org

0, 3, 1, 8, 2, 12, 3, 18, 4, 20, 5, 24, 6, 30, 7, 32, 8, 36, 9, 42, 10, 44, 11, 52, 12, 54, 13, 56, 14, 60, 15, 68, 16, 70, 17, 72, 18, 78, 19, 80, 20, 84, 21, 90, 22, 92, 23, 100, 24, 102, 25, 104, 26, 112, 27, 114, 28, 116, 29, 120, 30, 128, 31, 130, 32, 132, 33, 138, 34
Offset: 0

Views

Author

M. F. Hasler, Nov 04 2017

Keywords

Comments

Inspired by the "PrimeLatz" map A174221 (where the next three primes are added).
The trajectory under iterations of this map seems to end in the cycle 1 -> 3 -> 8 -> 4 -> 2 -> 1, for any starting value n. Can this be proved?
In order to develop a proof, one can consider the "condensed" version of the map which is: h(x) = odd_part(x+nextprime(x)); i.e., add the next prime, then remove all factors of 2. It is easy to see that this map verifies, for all x > 2, h(x) <= x + g(x)/2 where g(x) is the gap between the x and the next larger prime. Often, h(x) will be close to x/2 or even to x/4 or smaller. Nonetheless, for any power (iteration) of h, there are numbers for which h^m is increasing, e.g., h(h(h(x))) > x for x = 1, 525, 891, 1071, 1135, ..., and h^4(x) > x for x = 2, 1329, 5591, 8469, 9555, ...
From Robert Israel, Nov 08 2017: (Start)
It suffices to prove that if n > 1 is odd, the trajectory {x(i)} starting at x(0)=n contains some number < n. Let p = nextprime(n). As long as x(2k) is odd we have x(2k+1) = x(2k)+p and x(2k+2)=(x(2k)+p)/2 with
n <= x(2k) < x(2k+2) < p. But this can only continue finitely many times: eventually x(2k) must be even, and then x(2k+1) < p/2 < n (by Bertrand's postulate). (End)

Crossrefs

Cf. A174221 (the "PrimeLatz" map), A006370 (the "3x+1" map).

Programs

  • Maple
    seq(op([k,2*k+1+nextprime(2*k+1)]),k=0..100); # Robert Israel, Nov 08 2017
  • Mathematica
    Array[If[EvenQ@ #, #/2, NextPrime@ # + # &@ #] &, 69, 0] (* Michael De Vlieger, Nov 08 2017 *)
  • PARI
    A293975(n)=if(bittest(n,0),n+nextprime(n+1),n\2)

A174223 Add to 2n+1 the next three primes > 2n+1.

Original entry on oeis.org

11, 26, 36, 48, 50, 60, 72, 74, 88, 102, 104, 120, 122, 124, 138, 152, 154, 156, 168, 170, 184, 202, 204, 220, 222, 224, 240, 242, 244, 258, 272, 274, 276, 290, 292, 306, 324, 326, 328, 348, 350, 370, 372, 374, 390, 392, 394, 396, 408, 410, 420, 432, 434, 456, 480, 482, 508, 510, 512, 514, 516, 518, 520, 534, 536, 556, 558, 560, 576, 596, 598, 600, 602, 604
Offset: 0

Views

Author

N. J. A. Sloane, Nov 26 2010

Keywords

Comments

Bisection of A174221.

Crossrefs

Programs

  • Mathematica
    Array[Total@ Prepend[NextPrime[#, {1, 2, 3}], #] &[2 # + 1] &, 74, 0] (* Michael De Vlieger, Oct 25 2017 *)
  • PARI
    A174223(n)=sum(c=1, 3, n=nextprime(n+1),n=2*n+1) \\ M. F. Hasler, Oct 25 2017
    
  • Python
    from sympy import nextprime
    def a(n):
        base = 2*n + 1
        p1 = nextprime(base)
        p2 = nextprime(p1)
        p3 = nextprime(p2)
        return base + p1 + p2 + p3
    print([a(n) for n in range(74)]) # Michael S. Branicky, Nov 26 2021

A293982 Length (= size) of the orbit of n under iterations of A293975: x -> x/2 if even, x + nextprime(x) if odd; or -1 if the orbit is infinite.

Original entry on oeis.org

1, 5, 5, 5, 5, 8, 6, 13, 5, 11, 9, 9, 7, 10, 14, 8, 6, 14, 12, 14, 10, 12, 10, 13, 8, 19, 11, 17, 15, 11, 9, 17, 7, 17, 15, 15, 13, 15, 15, 13, 11, 15, 13, 18, 11, 16, 14, 22, 9, 16, 20, 14, 12, 18, 18, 16, 16, 14, 12, 12, 10, 10, 18, 22, 8, 20, 18, 20, 16, 18, 16, 16, 14
Offset: 0

Views

Author

M. F. Hasler, Nov 05 2017

Keywords

Comments

The orbit of x under f is O(x; f) = { f^k(x); k = 0, 1, 2,... }.
It is conjectured that for f = A293975, the trajectory (f^k(x); k >= 0) ends in the cycle 1 -> 3 -> 8 -> 4 -> 2 -> 1 for any starting value x.

Examples

			a(0) = 1 = # { 0 }, since 0 -> 0 -> 0 ... under A293975.
a(1) = 5 = # { 1, 3, 8, 4, 2 }, since 1 -> (1 + 2 =) 3 -> (3 + 5 =) 8 -> 4 -> 2 -> 1 -> 3 etc... under A293975.
a(2) = 5 = # { 2, 1, 3, 8, 4 }, since 2 -> 1 -> 3 -> 8 -> 4 -> 2 -> 1 etc... under A293975.
a(5) = 8 = # { 5, 12, 6, 3, 8, 4, 2, 1 }, since 5 -> (5 + 7 =) 12 -> 6 -> 3 -> (3 + 5 =) 8 -> 4 -> 2 -> 1 -> 3 etc... under A293975.
		

Crossrefs

Cf. A293975, A174221 (the "PrimeLatz" map), A006370 (the "3x+1" map).

Programs

  • Mathematica
    Table[Flatten[FindTransientRepeat[NestList[If[EvenQ[#],#/2,#+ NextPrime[ #]]&,n,100],3]]//Length,{n,0,80}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 13 2018 *)
  • PARI
    A293982(n,S=[n])={while(#S<#S=setunion(S,[n=A293975(n)]),);#S}

A294643 Length (= size) of the orbit of n under the "3x+1" map A006370: x -> x/2 if even, 3x+1 if odd. a(n) = -1 in case the orbit would be infinite.

Original entry on oeis.org

1, 3, 3, 8, 3, 6, 9, 17, 4, 20, 7, 15, 10, 10, 18, 18, 5, 13, 21, 21, 8, 8, 16, 16, 11, 24, 11, 112, 19, 19, 19, 107, 6, 27, 14, 14, 22, 22, 22, 35, 9, 110, 9, 30, 17, 17, 17, 105, 12, 25, 25, 25, 12, 12, 113, 113, 20, 33, 20, 33, 20, 20, 108, 108, 7, 28, 28
Offset: 0

Views

Author

M. F. Hasler, Nov 05 2017

Keywords

Comments

The orbit of x under f is O(x; f) = { f^k(x); k = 0, 1, 2, ... }, i.e., the set of all points in the trajectory of x under iterations of f.
The famous "3x+1 problem" or Collatz conjecture (also attributed to other names) states that for f = A006370, the trajectory (f^k(x); k >= 0) always ends in the cycle 1 -> 4 -> 2 -> 1, for any integer starting value x >= 0.

Examples

			a(0) = 1 = # { 0 }, since 0 -> 0 -> 0 ... under A006370.
a(1) = 3 = # { 1, 4, 2 }, since 1 -> (3*1 + 1 =) 4 -> 2 -> 1 -> 4 etc. under A006370.
a(3) = 8 = # { 3, 10, 5, 16, 8, 4, 2, 1 }, since 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 -> 4 etc. under A006370.
		

Crossrefs

Cf. A006370 (Collatz or 3x+1 map), A008908 (number of steps to reach 1), A174221 (the "PrimeLatz" map: add 3 next primes), A293980, A293975 (variant: add the next prime), A293982.
Showing 1-10 of 10 results.