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

A350035 Number of steps to reach 1 under repeated applications of the A350034 map, or -1 if 1 is never reached.

Original entry on oeis.org

0, 1, 1, 2, 11, 1, 3, 3, 2, 12, 7, 2, 9, 4, 12, 4, 6, 2, 6, 13, 4, 8, 16, 3, 6, 10, 3, 5, 13, 12, 12, 5, 8, 7, 12, 2, 14, 7, 10, 14, 9, 4, 4, 9, 13, 17, 21, 4, 11, 7, 7, 11, 19, 3, 19, 6, 7, 14, 18, 13, 9, 13, 5, 6, 13, 8, 8, 8, 17, 13, 20, 3, 11, 15, 7, 8, 15, 10, 10, 15, 4, 10, 15, 5, 22, 5
Offset: 1

Views

Author

Keywords

Examples

			5 -> 26 -> 13 -> 66 -> 11 -> 56 -> 28 -> 14 -> 7 -> 36 -> 6 -> 1. Thus a(5) = 11.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 0, 1+
          a((g-> `if`(g>1, n/g, 5*n+1))(igcd(n, 6))))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 19 2022
  • Mathematica
    f[n_]:=If[GCD[n,6]>1,n/GCD[n,6],5*n+1];Table[f[n],{n,0,100}];
    S[n_]:=S[n]=Which[n==1,0,f[n]==1,1,True,1+S[f[n]]];
    Table[S[n],{n,1,86}]
  • PARI
    A350034(n) = my(g = gcd(n, 6)); if (g>1, n/g, 5*n+1);
    a(n)=my(r=0); while(n != 1, n = A350034(n); r+=1); r \\ Winston de Greef, Oct 02 2023
Showing 1-1 of 1 results.