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.

A377482 Iterated integer log of n: denote A001414(n) by b(n). a(n) = n if b(n) = n. Otherwise, a(n) = b(n) + b(b(n)) + ... + b^k(n), where k is the smallest integer such that b^k(n) is prime.

This page as a plain text file.
%I A377482 #6 Nov 19 2024 02:25:37
%S A377482 1,2,3,4,5,5,7,11,11,7,11,7,13,20,19,19,17,19,19,20,17,13,23,20,17,34,
%T A377482 20,11,29,17,31,17,34,19,19,17,37,38,35,11,41,19,43,34,11,42,47,11,34,
%U A377482 19,40,17,53,11,35,13,35,31,59,19,61,67,13,19,37,35,67
%N A377482 Iterated integer log of n: denote A001414(n) by b(n). a(n) = n if b(n) = n. Otherwise, a(n) = b(n) + b(b(n)) + ... + b^k(n), where k is the smallest integer such that b^k(n) is prime.
%C A377482 Can be understood as an exotic way of measuring how far a number is from being prime, since omitting n = 1, 4, |a(n) - n| = 0 if and only if n is prime. Note that A274718(n) = k - 1 when a(n) = b(n) + b(b(n)) + ... + b^k(n). The scatter plot for n >= 10000 shows intriguing regularities.
%e A377482 a(24) is computed as follows: 24 = (2^3) * 3, 2 * 3 + 3 = 9. 9 = (3^2), 3 + 3 = 6. 6 = 2 * 3, 2 + 3 = 5. Since 5 is prime, we stop and take the sum: 9 + 6 + 5 = 20.
%o A377482 (Python)
%o A377482 from sympy import*
%o A377482 def a(n):
%o A377482  t=0
%o A377482  while n not in (1,4) and not isprime(n):
%o A377482   n=sum(p*e for p,e in factorint(n).items());t+=n
%o A377482  return t or n
%Y A377482 Cf. A001414, A274718.
%K A377482 nonn,easy,look
%O A377482 1,2
%A A377482 _Louis-Simon Cyr_, Oct 29 2024