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.

A342176 Tower of primes modulo n: a(n) = (2^3^5^7^ ... ^prime(n)) mod n.

Original entry on oeis.org

0, 0, 2, 0, 3, 2, 1, 0, 8, 8, 8, 8, 8, 8, 8, 0, 8, 8, 18, 8, 8, 8, 2, 8, 8, 8, 26, 8, 26, 8, 8, 0, 8, 8, 8, 8, 6, 18, 8, 8, 8, 8, 32, 8, 8, 2, 7, 32, 29, 8, 8, 8, 18, 26, 8, 8, 56, 26, 42, 8, 8, 8, 8, 0, 8, 8, 58, 8, 2, 8, 18, 8, 1, 6, 8, 56
Offset: 1

Views

Author

Peter Schorn, Mar 04 2021

Keywords

Comments

a(n) = 0 iff n is a power of 2.

Examples

			a(1) = 0 = 2 mod 1. a(2) = 0 = 2^3 mod 2. a(3) = 2 = 2^3^5 = 2^243 = 2 mod 3.
		

Crossrefs

Cf. A000040.

Programs

  • PARI
    { a(n, m=n, s=2) = local(g); if(s==prime(n), return(n%m)); g=s^valuation(m, s); m\=g; lift(chinese(Mod(0, g), Mod(s, m)^a(n, eulerphi(m), nextprime(s+1)) )) }