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.

A358166 a(1) = 13; for n > 1, if a(n-1) is even, then a(n) = a(n-1)/2; otherwise, a(n) = a(n-1) + prime(a(n-1)).

Original entry on oeis.org

13, 54, 27, 130, 65, 378, 189, 1318, 659, 5592, 2796, 1398, 699, 5972, 2986, 1493, 13996, 6998, 3499, 36102, 18051, 218932, 109466, 54733, 730334, 365167, 5622764, 2811382, 1405691, 23685544, 11842772, 5921386, 2960693, 52246474, 26123237, 521463688, 260731844, 130365922, 65182961, 1364229390
Offset: 1

Views

Author

Sander G. Huisman, Nov 01 2022

Keywords

Comments

Does this sequence become cyclic? All the sequences defined the same as this one but with 1 <= a(1) <= 12 are known to become cyclic.
a(81) = 1977693361846020549, so calculating a(82) will require calculating the 1977693361846020549th prime.

Examples

			a(1) = 13 is odd, so a(2) = 13 + prime(13) = 13 + 41 = 54.
a(2) = 54 is even, so a(3) = a(2)/2 = 54/2 = 27.
a(3) = 27 is odd, so a(4) = 27 + prime(27) = 27 + 103 = 130, etc.
		

Crossrefs

Programs

  • Mathematica
    NestList[If[EvenQ[#], #/2, # + Prime[#]] &, 13, 40]
  • PARI
    lista(nn) = my(va = vector(nn)); va[1] = 13; for (n=2, nn, if (va[n-1] % 2, va[n] = va[n-1] + prime(va[n-1]), va[n] = va[n-1]/2);); va; \\ Michel Marcus, Nov 12 2022