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

A352907 Records in the number of iterations in the 3x+1 sequences required to reach a power of 2.

Original entry on oeis.org

0, 3, 4, 12, 15, 16, 19, 107, 108, 111, 114, 117, 120, 123, 126, 139, 140, 166, 174, 177, 178, 204, 212, 233, 257, 263, 271, 274, 277, 303, 306, 319, 335, 346, 349, 370, 378, 381, 438, 444, 465, 504, 520, 523, 526, 552, 555, 558, 579, 592, 608, 660, 681, 684
Offset: 1

Views

Author

Omar E. Pol, Apr 07 2022

Keywords

Comments

Records of the number of nonpowers of 2 in the sequences 3x+1.
Is this a finite sequence?

Crossrefs

Records in A208981.
Cf. A352939 (first differences).
Cf. A347270 (gives all 3x+1 sequences).

Programs

  • Mathematica
    f[n_] := -1 + Length @ NestWhileList[If[OddQ[#], 3*# + 1, #/2] &, n, !IntegerQ @ Log[2, #] &]; Union @ FoldList[Max, Array[f, 10^5]] (* Amiram Eldar, Apr 08 2022 *)

Extensions

More terms from Alois P. Heinz, Apr 07 2022

A353265 Partial sums of A208981.

Original entry on oeis.org

0, 0, 3, 3, 4, 8, 20, 20, 35, 37, 47, 52, 57, 70, 83, 83, 91, 107, 123, 126, 127, 138, 149, 155, 174, 180, 287, 301, 315, 329, 431, 431, 453, 462, 471, 488, 505, 522, 552, 556, 661, 663, 688, 700, 712, 724, 824, 831, 851, 871, 891, 898, 905, 1013, 1121, 1136, 1164, 1179, 1207, 1222, 1237, 1340, 1443, 1443
Offset: 1

Views

Author

Omar E. Pol, Apr 09 2022

Keywords

Crossrefs

Cf. A208981, A347270 (gives all 3x+1 sequences).

Programs

  • Mathematica
    Accumulate @ Table[-1 + Length @ NestWhileList[If[OddQ[#], 3*# + 1, #/2] &, n, ! IntegerQ @ Log[2, #] &], {n, 1, 64}] (* Amiram Eldar, Apr 09 2022 *)
  • PARI
    ispow2(n)=n>>=valuation(n, 2); n==1;
    f(n) = my(s); while(!ispow2(n), n=if(n%2, 3*n+1, n/2); s++); s; \\ A208981
    a(n) = sum(i=1, n, f(i)); \\ Michel Marcus, Apr 13 2022
Showing 1-2 of 2 results.