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.

A174221 a(n) = n/2 if n is even, otherwise add to n the next three primes > n.

Original entry on oeis.org

0, 11, 1, 26, 2, 36, 3, 48, 4, 50, 5, 60, 6, 72, 7, 74, 8, 88, 9, 102, 10, 104, 11, 120, 12, 122, 13, 124, 14, 138, 15, 152, 16, 154, 17, 156, 18, 168, 19, 170, 20, 184, 21, 202, 22, 204, 23, 220, 24, 222, 25, 224, 26, 240, 27, 242, 28, 244, 29, 258, 30, 272, 31, 274, 32, 276, 33, 290, 34, 292, 35, 306, 36, 324, 37, 326, 38, 328, 39, 348, 40, 350, 41, 370, 42
Offset: 0

Views

Author

N. J. A. Sloane, Nov 26 2010

Keywords

Comments

Related to the PrimeLatz conjecture, which states that if this map k -> a(k) is iterated, starting at any n >= 0, then the trajectory will eventually enter a loop.
Computations have shown that up to 10^8, there is only one loop (apart from the fixed point 0). It is given for example by terms 2 through 31 of A193230, the smallest of its 30 elements being 9.
See A293980 for the number of iterations required to reach an element of this loop, and for further study of trajectories under iterations of this map.

References

  • Eric Angelini, Posting to Math Fun Mailing List, Nov 26, 2010
  • Bill Thurston, Posting to Math Fun Mailing List, Nov 26, 2010

Crossrefs

Bisection gives A174223.
Cf. A193230 (trajectory of 1 under this map), A293979 (trajectory of 83), A293980.

Programs

  • Maple
    f:=proc(n) local p; p:=nextprime;
    if n mod 2 = 0 then n/2 else
    n+p(n)+p(p(n))+p(p(p(n))); fi; end;
  • Mathematica
    Array[If[EvenQ@ #, #/2, Total@ Prepend[NextPrime[#, {1, 2, 3}], #]] &, 85, 0] (* Michael De Vlieger, Oct 25 2017 *)
  • PARI
    A174221(n)=bittest(n,0)||return(n\2);n+sum(c=1,3,n=nextprime(n+1)) \\ M. F. Hasler, Oct 25 2017

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

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

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