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.

A114871 Numbers of the form (p-1)p^k (where p is a prime and k>=0) in ascending order.

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 22, 28, 30, 32, 36, 40, 42, 46, 52, 54, 58, 60, 64, 66, 70, 72, 78, 82, 88, 96, 100, 102, 106, 108, 110, 112, 126, 128, 130, 136, 138, 148, 150, 156, 162, 166, 172, 178, 180, 190, 192, 196, 198, 210, 222, 226, 228, 232, 238, 240, 250
Offset: 1

Views

Author

Franz Vrabec, Jan 03 2006

Keywords

Comments

These numbers play a crucial role in inverting Euler's totient function.

Examples

			18 is an element of the sequence because 18=(3-1)3^2 and 3 is a prime.
		

Programs

  • Maple
    N:= 1000: # for terms <= N
    S:= {}: R:= NULL:
    p:= 1:
    while p <= N do
      p:= nextprime(p);
      S:= S union {seq((p-1)*p^k, k = 0..ilog[p](N/(p-1)))};
      R:= R, seq((p-1)*p^k, k = 0..ilog[p](N/(p-1)))
    od:
    sort(convert(S,list)); # Robert Israel, Feb 10 2021
  • Mathematica
    Take[Union@ Flatten@ Table[(Prime[n] - 1)Prime[n]^k, {n, 60}, {k, 0, 7}], 61] (* Robert G. Wilson v, Jan 05 2006 *)

Extensions

More terms from Robert G. Wilson v, Jan 05 2006