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.

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

This page as a plain text file.
%I A350035 #22 Oct 02 2023 20:55:41
%S A350035 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,
%T A350035 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,
%U A350035 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
%N A350035 Number of steps to reach 1 under repeated applications of the A350034 map, or -1 if 1 is never reached.
%H A350035 Winston de Greef, <a href="/A350035/b350035.txt">Table of n, a(n) for n = 1..10000</a>
%e A350035 5 -> 26 -> 13 -> 66 -> 11 -> 56 -> 28 -> 14 -> 7 -> 36 -> 6 -> 1. Thus a(5) = 11.
%p A350035 a:= proc(n) option remember; `if`(n=1, 0, 1+
%p A350035       a((g-> `if`(g>1, n/g, 5*n+1))(igcd(n, 6))))
%p A350035     end:
%p A350035 seq(a(n), n=1..100);  # _Alois P. Heinz_, Jan 19 2022
%t A350035 f[n_]:=If[GCD[n,6]>1,n/GCD[n,6],5*n+1];Table[f[n],{n,0,100}];
%t A350035 S[n_]:=S[n]=Which[n==1,0,f[n]==1,1,True,1+S[f[n]]];
%t A350035 Table[S[n],{n,1,86}]
%o A350035 (PARI)
%o A350035 A350034(n) = my(g = gcd(n, 6)); if (g>1, n/g, 5*n+1);
%o A350035 a(n)=my(r=0); while(n != 1, n = A350034(n); r+=1); r \\ _Winston de Greef_, Oct 02 2023
%Y A350035 Cf. A350034, A006370, A089128, A006577, A133420.
%K A350035 nonn
%O A350035 1,4
%A A350035 _José María Grau Ribas_, Jan 19 2022