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.

Original entry on oeis.org

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, 20, 11, 29, 17, 31, 17, 34, 19, 19, 17, 37, 38, 35, 11, 41, 19, 43, 34, 11, 42, 47, 11, 34, 19, 40, 17, 53, 11, 35, 13, 35, 31, 59, 19, 61, 67, 13, 19, 37, 35, 67
Offset: 1

Views

Author

Louis-Simon Cyr, Oct 29 2024

Keywords

Comments

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.

Examples

			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.
		

Crossrefs

Programs

  • Python
    from sympy import*
    def a(n):
     t=0
     while n not in (1,4) and not isprime(n):
      n=sum(p*e for p,e in factorint(n).items());t+=n
     return t or n