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.

A237661 Indices of records in A237660.

Original entry on oeis.org

3, 42, 75, 151, 2730, 7281, 14563, 174762, 184111, 932067, 11184810, 13256071, 26512143, 715827882, 1908874353
Offset: 1

Views

Author

Kival Ngaokrajang, Feb 11 2014

Keywords

Crossrefs

Cf. A237660.

Programs

  • C
    See Greathouse link
    
  • Mathematica
    With[{s = Table[If[AllTrue[#, EvenQ], 0, SelectFirst[Reverse@ #, OddQ]] &@ Most@ Rest@ NestWhileList[If[EvenQ@ #, #/2, (3 # + 1)/2] &, n, # > 1 &], {n, 2, 10^5}] }, 1 + Values[#][[All, 1]] &@ Rest@ KeySort@ PositionIndex@ s] (* Michael De Vlieger, Aug 14 2017 *)
  • PARI
    A237660(n)=my(k); if(n%2,n=3*n+1); n>>=valuation(n,2); if(n==1,return(0)); k=n; while(1, n+=(n+1)>>1; n>>=valuation(n,2); if(n==1, return(k), k=n))
    r=0; for(n=1,1e8, t=A237660(n); if(t>r, r=t; print1(n", "))) \\ Charles R Greathouse IV, Aug 14 2017

Extensions

a(11)-a(15) from Charles R Greathouse IV, Aug 14 2017

A238192 In the Collatz (3x+1) iteration of n, the last odd number before 1, or 0 if there is no such number.

Original entry on oeis.org

0, 0, 5, 0, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 21, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 21, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 85, 5, 5, 5, 5, 5, 5, 5, 5, 21, 85, 5
Offset: 1

Views

Author

T. D. Noe, Feb 21 2014

Keywords

Comments

Another version of A237660. The only terms appearing here are 0, 5, 21, 85, ..., which is A002450 without 1.

Crossrefs

Cf. A002450 ((4^n-1)/3), A070165 (Collatz trajectories).

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[c = Collatz[n]; co = Select[c, OddQ]; If[Length[co] == 1, 0, co[[-2]]], {n, 100}]
Showing 1-2 of 2 results.