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.

A381329 Number of steps for n to reach 1 under the map x -> x/2 if x is even, x -> 2*x+1 if x is prime or a perfect power, otherwise x -> gpf(x)-1 where gpf(x) = A006530(x).

This page as a plain text file.
%I A381329 #15 Feb 21 2025 09:40:50
%S A381329 0,1,5,2,16,6,4,3,10,17,15,7,20,5,3,4,8,11,9,18,7,16,14,8,6,21,19,6,7,
%T A381329 4,8,5,18,9,7,12,4,10,8,19,23,8,8,17,3,15,13,9,19,7,5,22,11,20,18,7,
%U A381329 12,8,6,5,21,9,7,6,8,19,4,10,17,8,9,13,8,5,3,11,18
%N A381329 Number of steps for n to reach 1 under the map x -> x/2 if x is even, x -> 2*x+1 if x is prime or a perfect power, otherwise x -> gpf(x)-1 where gpf(x) = A006530(x).
%C A381329 Does every n reach 1?
%e A381329 n=7 reaches 1 by 7 -> 15 -> 4 -> 2 -> 1 which is a(7)=4 steps.
%e A381329 Starting from 47993 yields 4362, 2181, 726, 363, 10, 5, 11, 23, 47, 95, 18, 9, 19, 39, 12, 6, 3, 7, 15, 4, 2, 1. Thus a(47993)=22.
%t A381329 s[n_] := Which[n == 1, 1, EvenQ[n], n/2, PrimeQ[n] || GCD @@ ((f = FactorInteger[n])[[;; , 2]]) > 1, 2*n + 1, True, f[[-1, 1]] - 1]; a[n_] := -1 + Length@ NestWhileList[s, n, # > 1 &]; Array[a, 100] (* _Amiram Eldar_, Feb 20 2025 *)
%Y A381329 Cf. A006530.
%K A381329 nonn
%O A381329 1,3
%A A381329 _Bill McEachen_, Feb 20 2025