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.

A089576 Let p_k = k-th prime, let f((p_k)^n) = m where m is the largest power of p_(k+1) < (p_k)^n. a(n) = number of iterations of f to reach 1, starting from n and starting from k = 1.

This page as a plain text file.
%I A089576 #21 Sep 08 2021 21:18:10
%S A089576 0,1,2,2,3,4,4,4,5,5,6,6,6,7,7,7,7,7,8,8,8,8,8,9,10,10,10,11,11,11,11,
%T A089576 11,12,12,12,13,13,13,13,14,15,15,15,15,15,15,15,15,15,15,16,16,16,17,
%U A089576 18,18,18,18,18,18,18,18,19,19,19,19,19,20,20,20,21,21
%N A089576 Let p_k = k-th prime, let f((p_k)^n) = m where m is the largest power of p_(k+1) < (p_k)^n. a(n) = number of iterations of f to reach 1, starting from n and starting from k = 1.
%C A089576 The steps are a downward recursion in the prime powers: start at 2^n in A000961, i.e., at A000961(A024622(n)); skip to the left to the next smaller power 3^e_3 (see A024623), then to the left to the next smaller power 5^e_5, to the left to the next smaller power 7^e_7 etc., and count the steps to reach 1. - _R. J. Mathar_, Sep 08 2021
%H A089576 Michael De Vlieger, <a href="/A089576/b089576.txt">Table of n, a(n) for n = 0..10000</a>
%e A089576 a(5)=4 as f(2^5)=3^3 < 2^5, f(3^3)=5^2 < 3^3, f(5^2)=7 < 5^2 and f(7)=11^0 < 7.
%p A089576 # largest exponent m of prime(k+1)^m< prime(k)^n.
%p A089576 A089576f := proc(k,n)
%p A089576     local pkn,pplus,m ;
%p A089576     pkn := ithprime(k)^n ;
%p A089576     pplus := ithprime(k+1) ;
%p A089576     for m from 1 do
%p A089576         if pplus^m >= pkn then
%p A089576             return m-1 ;
%p A089576         end if;
%p A089576     end do:
%p A089576 end proc:
%p A089576 A089576 := proc(n)
%p A089576     local itr,m;
%p A089576     if n = 0 then
%p A089576         return 0 ;
%p A089576     end if;
%p A089576     m := n ;
%p A089576     for itr from 1 do
%p A089576         m := A089576f(itr,m) ;
%p A089576         if m = 0 then
%p A089576             return itr ;
%p A089576         end if;
%p A089576     end do:
%p A089576 end proc:
%p A089576 seq(A089576(n),n=0..80) ; # _R. J. Mathar_, Sep 07 2021
%t A089576 Array[-1 + Length@ NestWhile[Append[#1, #2^Floor@ Log[#2, #1[[-1]]]] & @@ {#, Prime[Length@ # + 1]} &, {2^#}, #[[-1]] > 1 &] &, 71, 0] (* _Michael De Vlieger_, Sep 08 2021 *)
%Y A089576 Row lengths of A347285.
%K A089576 easy,nonn
%O A089576 0,3
%A A089576 _Naohiro Nomoto_, Dec 29 2003
%E A089576 More terms from _Michael De Vlieger_, Sep 08 2021