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-4 of 4 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.)

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

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))

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))
Showing 1-4 of 4 results.